0% found this document useful (0 votes)
13 views21 pages

ADITYA POLYTECHNIC Bee1

The document is a micro project submitted by Shaikh Bilal Hafez Abdul Qayyum for the Programming in C course at Aditya Polytechnic Beed. It covers fundamental concepts of the C programming language, including algorithms, flowcharting, header files, and variable declaration. The project also includes examples and explanations of keywords, identifiers, constants, and the structure of a C program.

Uploaded by

zeeshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views21 pages

ADITYA POLYTECHNIC Bee1

The document is a micro project submitted by Shaikh Bilal Hafez Abdul Qayyum for the Programming in C course at Aditya Polytechnic Beed. It covers fundamental concepts of the C programming language, including algorithms, flowcharting, header files, and variable declaration. The project also includes examples and explanations of keywords, identifiers, constants, and the structure of a C program.

Uploaded by

zeeshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

ADITYA POLYTECHNIC Beed

MICRO PROJECT ON
Submitted By
“Shaikh Bilal Hafez Abdul Qayyum”

Under The Guidance of


Pro. Ms. Shaikh M.I

For The Subject and CODE


PROGRAMMING IN C
312303
2024-25
CERTIFICATE
This is to Certify that Ms. Shaikh Bilal Hafez
Abdul Qayyum
Second semester of Diploma in Computer
Science and Engineering has successfully
completed the page first year 2024-25 as
prescribed in MSBTE curriculum
Under the guidance of subject teacher Pro.
Ms. Shaikh M.I

Enrollment No. 24511430066

Name and signature of guide


……………………………………………………………………
……………………………………………………………………
Index

Sr. Content. Page.No

1. INTRODUCTION IN C 1
2. Flowcharting 2
3. Algorithm efficiency 5
4. Header Files 7
5. Statement 9
6. Keyword 10
7. Identifiers 11
8. Decimal number system 13
9. Declaration 15
10. Initialization 16
# INTRODUCTION IN C
C is a procedural programming language initially
developed by Dennis Ritchie in the year 1972.at Bell
Laboratories of AT&T Labs. It was mainly developed as a
system programming language to write the UNIX
operating system.

#ALOGORITHAM
The word Algorithm means” A set of finite rules or
instructions to be followed in calculations or other
problem-solving operations”
Or

A programming algorithm is a procedure or formula used


For solving a problem. It is based on conducting a
sequence of specified actions in which these actions in
which these actions describe how to do something, and
your computer will do it exactly that way every time. An
algorithm works by following a procedure, made up of
Inputs
EX: - calculate the square of a number
1 .start.
2 .Input the number (N) whose square you want to
find.
3 .multiply the number (N) by itself.
4 .Store the result of the multiplication in a variable
(result).
5. Output the value of the variable (result), which
Represents the square of the input number.
6. End.

Page 1
 Flow
charting

1)Terminator :-

Termia ror is flowchart shape indieales start or


end if the process.

2) Process :- a rectangvlar flowch shape indi cates a


norm al / generic process flow step example “Add,
tox ” , “M= M *F”
Or similar

3)DLECISION :-

This symbol is used when a becisi on needs to be


made commonly a yes / no Question or True / false test.
Page 2

4)connector :-
connector

conneclore are generally used in complex or


multi – sheet diagram.

Data:-
Data is used input or output (I/O) for a process.
Input / Output

 Working with flow chart :-


Example:-
Draw the flowchart to calculate volume of cude.
Start
Getuer input liength width,hight
Multiple length width height
End
Page 3

 Notion of algorithm :-
- Notion means idea concept.
- A set of initial data that abstarads rods
of the solving problem

- A set of transfonmation relations with are


operated based on a set of rules whose
cantent and sequence represent the
substance of algorithm it self
Page 4

 Algo
rithm efficiency
- Worst – case, best case, Average case.
- Algorithm efficiency depends on the input size n.
- Some algorithm efficiency depends on type of
input.
- Worst – case efficiency:-
[Number of times the basic operation will be
executed] for the best case input of size n.

- Best – case efficiency:-


[Number of times the basic operation will be
executed] for the fastest amang all possible
Inputs of size n.
- Average – case efficiency:-
Average time taken [Number of times the
basic operation will be executed] to solve all the
possible instances of the input

- Here is a list of classes of function that are


commonly encountered when analyzing algorithm
constant time.
- A ssignirg value to some variable.
- Insertimg an element in an array.
- Retrithmic element I from an array.
Page 5

 Algorithmic problem:-
Algorithm to add two numbers entered users.
Step 1:- Start.
Step 2:- Declare variables A, B&C.
Step 3:- Read value A&B
Step 4:- Add A and B and assign
the result to sum
c= a+b
Step 5:- Display C.
Step 6:-Stop.

 GENERAL STRUCTURE OF C PROGRAM


Header file
Void main ()
{
Variable declaration
Statements
}
Page 6

1. Header Files:

 C program requires use of some library function. Which


are included in some header files
 When a c. program is using some library function we have
to include the header file

 The header files can be included in a program by


mean of #include directive

 there are various header files as


Stdio.h
conio.h
Math.h

 These files should be included as


#include <Stdio.h>
#include <conio.h>

 Header file library that lets us work with input and output
function such as Print f
 Header files should be included in program first

Page 7

2. Void Main ( )

- Void Main () is the function from where & Start execution of


the program
- All declaration of the variables and Statement
Should be written inside the main
- Void main () should always start with {(opening
curly brace) and end with} (Closing curly brace).
- Void main () should always come after the
header file.

3. Variable Declaration:

 All Variables used in program should be declared


along with their data type in the beginning of the
program It Self inside the void main ()
 C does not allows variable declaration after the
executable statement so, keep in mind that all
variables are to be declared first
Page 8

1. Statement:
All executable statements should come after the
declarations of variables

 C does not allow declaration of Variables once


Statements are written in program.

#Token
 The language code is formed of the combination of
character set.
 A token in a is sequence of characters that
represents specific element in a c program

 Token are the smallest unit of G program and are the


block that make up the program.
The following different types of token are used in c
1. Keyword
2. Identifiers
3. constants
Page 9

1 .Keyword:
 Keyword are nothing but system defined identifiers
key words are reserved words of the language
 They have specific meaning in the language and
Cannot be used by the programmer as variable or
constant name
 The C language specifics 32 keywords and other
reserved words keywords are listed as below
Auto if return Continue case
const new else long struct
static char break while struct
int double goto for unsigned
float void switch do Size of
default enum register extern union
volatile floath

 C is a case sensitive it means these must be used as it is.


Page 10

Example:-
Else is keyword so it cannot be used as else
Or else it must be used as else.

 Identifiers:-
 Identifiers are names that are used to identify element in a
program such as variables, function and labels
 An identifiers can be composed of letters such as
uppercase, lowercase letters underscore, digits.

 Identifiers are user defined words in the C language.


 We can say that an identifier is a collection of
alphanumeric characters that be gains either with an
alphabetical Character or an underscore which are used to
represent various programming element such as variable,
function, arrays etc.
 Identifies is a word used by a programmer to name a
variable, function or label.

 identifier consist of letters and digits


 example&
 Int a, b, Sum;
 Int is a variable data types and a, b, sum is a identifier

Page 11

 Constant

A Constant is Valve Corn not an identinfiro whose value


cannot be change thorough a axecution of the program.

Types of Canstant

1. number/ointeger Constant
2 .Character constant
3 .string constant.

 number / integer constant

- integer Constant is represent a number that an


integral value and is determined at compiler
time
- integer constant can be written in three
different number system

1) Decimal number system.


2) Octal number system
3) Hexadecimal number system

Page 12

 Decimal number system

- A decimal number system integer Constant can


consist of any combination of digits from the set o
through a

- If the constant contain two or more digits the first


digit must be other then o

- Valid decimal integer constants are show below


1, 46, 23, 456, 9999
- The decimal integer constants should not contain
the following

- Comma ( ' ) between number


e.9:- 12.13
- Decimal Point between number
E.g 12.34
- Should not sturt with O
E.g:- 0 1 2 3 4 5

Page 13

 octal number

- an octal integer constant can consist of an combination of


digital taken from the set through 7
- But the digits must be o (zero), in order to identify the
constant as an Octal number
- Base 8 number often known as octal number eight
separate digits 0,1,2,3,4 5.6, and 7
- Valid Octal number constants are
02, 045, 076, 012
Hexadecimal number
- A hexadecimal integer constant must beging with either ox
of ox
- it can then be followed by and combination of digit taken
from the sets O through a and a through f
- 0.1.2.3.4.5.6.7.8.9. A.B.C.D.E.F
- Valid hexadecimal integer constant are OX. Ox2o ох2заb
Page 14

 Declaration

- Before a program is written the able reclined in a program


are to be declared with considering that value they may
contain
- all variables must be declared before they can he used in a
program
- a declaration consists of a data type followed by variable
name, ending with a semicolon
- consider the statement below.

int a;
Float b:
Chat J;
Sum;

- every statement in c ends with semi colon(:)


- e can declare more than on variables in on line having
some of some type in data type like
int a, b, c;
float a b. c;
Page 15

 Initialization:

- initial values can be assigned at the Same time


when they are declared with in a type declaration

- the declaration must consist of a data type


followed by a variable name, an equal sign (=)
- a semicolon (must appears at the en

E-g:-
int c= 5
float a=15;

 addition Constant

#include <stdio.ht
int main()
{ int a = 10;
int b= 5;
int sum = atb :
Paint f ("add of two integer % d", Sum);
}
Page 16

You might also like