- General form of printf is printf(“<format
string>”,< variables which you give>);
- This <format string> is used to print the values of
the variables in out put.
Some of them are :
Float : %f is its symbol and used for printing real
Integer : %d is its symbol and used for printing integer
Character : %c is its symbol and used for printing
C Instructions :
- we have to write a statement to declare the type
variables we used in the program.
- This statement should be written at the beginning of
Mainly these are of three types :
Int : It is for integers. Ex:- int a,b ; int bas, ad.
Float : It is for real values. Ex:- float kot,
Char: It is for charecters .ex:- char name,code.
Simple example on above topic
int a = 7;
float k =14.6;
printf("you have entered a=%d”,a );
printf(“you have entered k =%d” ,k);
- You have entered a=7
- You have entered k =14.6
- is used to end the line.