Format Strings
Format Strings
Format strings are used to define printing or scanning value belong to which data type.
| Data Types | Format String | 
| int | %d | 
| unsigned int | %u | 
| float | %f | 
| long | %ld | 
| unsigned long | %lu | 
| double | %lf | 
| long double | %lf | 
| char | %c / %s | 
| unsigned char | %c / %s | 
Example:-
#include<conio.h>
void main()
int i=10;
float f=10.5;
char c='s';
char  s[10]="hellow";
printf("\n  Integer : %d",i);
printf("\n  Float : %f",f);
printf("\n  Character : %c",c);
printf("\n  String : %s",s);
getch();
Comments
Post a Comment