Program To Use Printf() Function To Print Data Types

printf() functiion


/* program to use
 printf() function
	to print data types
		*/

 #include<stdio.h>
 #include<conio.h>

 int main()
 {
 clrscr();

 char ch='A';
 char str[25]="Deepak Garg";
 int no=120;
 float rat=123.45;
 double db1=12345.2333;
 printf("Character is %c \n",ch);
 printf("integer value is %d\n",no);
 printf("String is %s \n",str);
 printf("float value is %f\n",rat);
 printf("Double value is %lf \n");
 printf("Octal value is %o\n",no);
 printf("Hexadecimal value is %x \n",no);
 getch();
 }

 

Output

printf 



Facebook Likes

Youtube