Myppt
Myppt
• You can also use the C/C++ programming language to create the Google Chrome web
browser and the Google File
Data types
Input and Output statement are used to read and write the
data in C
programming.
It represent the data and type of the variable . It describes size of memory to be
allocated for the variable..
2.Derived Defined(Arrays,Pointers,Function)
3.User Defined(Structures,Unions…)
OPERATORS
• Arthemetic Operators(+,-,*,/.%)
• Relational Operators(>,<,>=,<=,==,!=)
• Bistwise Operators(&,|)
• Logical Operators(&&,||,!)
• Assignment Operators(=)
• Increment/Derement Operators(++,--)
Variable Declaration:
<<Datatype>> <<variable name>;
Ex:int val;
Variable Intilization:
<<Datatype>> <<variable name>> = value;
Ex:int val=10;
LOOPS
do
{
2.Exit Control Loop(do while) -----;
-----;
}while(condition);
Loop Control Statements:
1.break; //it stops execution and come out from the loop
2.Continue;//it skips the execution control goes to update expression
EXAMPLE PROGRAMS ON LOOPS
int i=0; do
for(int i=0;i<10;i++) While(i<10) {
{ { printf(“%d
printf(“%d “,i); printf(“%d “,i);
“,i); i++;
} }while(i<10);
}
o/p:0 1 2 3 4 5 6 7 8 9 o/p: 0 1 2 3 4 5 6 7 8 9
o/p:0 1 2 3 4 5 6 7 8 9
int i; int i;
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++)
if (i == 4) { {
break; if (i == 4) {
} continue;
printf("%d ", i); }
} printf("%d\n", i);
O/P:0 1 2 3 }
o/p:01 2 3 5 67 8 9
CONDITIONAL
STATEMENTS
statements; statements;
break; break;
}
FUNCTIONS
ACTUAL PARAMETERS :
The arguments which are present in the called function are Actual
Argument #include<stdioh>
Int add(int,int)Function Declaration
add(a,b);Called Function Int main()
{
int a=10,b=20;
FORMAL ARGUMENTS :
add(a,b);Called Function
The arguments which are present in the function definition are }
Int add(int c,int d)Function Definition
Formal Arguments..
{
Int add(int c,int d)Function Definition printf(“%d”,c+d);
return 0;
}
ARRAYS
printf(“%d “,arr[i]);
}
}
TWO DIMENSIONAL ARRAYS
Two Dimensional arrays are also called as matrix .It stores the values in rows
and coloumns..
int x[3][4];
for(int i = 0; i < 3; i++)
Syntax :
{
Datatype arrayname[row][col]; for(int j = 0; j < 4;
j++){
Example :-
scanf(“%d”,&x[i][j]);
int arr[2][2]={{1,2},{3,4}};
col1 col2 printf(“%d”,x[i][j]);
}
row1 1 2
}
row2 3 4
STRUCTURES