printf() is
used for printing results
printf(“control
string”, arg1,arg2…..);
Control
String specifies
characters
that will be printed on screen
Format
Specifications
Escape
sequence characters
Examples
printf(“Programming
in C”);
printf(“\n”);
printf(“%d”,x);
printf(“x=%d\n”,x);
printf(“The
value of a is %d”,a);
printf does
not supply new line automatically. Thus ‘\n’ is used
Integer
Examples
Real
Examples
Syntax:
%w.pf
w
indicates the number of digits used for display
p
indicates the number of digits to be displayed after decimal
Let y=98.7654;
String
Examples
No comments:
Post a Comment