Write a prigrame to print the values of main data types used in C.

 

#include<stdio.h>

#include<conio.h>

int main()            //or void main(void) can also be used

{

int i=200;            //int is an abbreviation of integer

char c=67;            //ascii code for 67is “c”

float f=20.50;        //float fornat code is %f

clrscr();             //clear screen

printf(“value of integer is=%d\n”,i);   //format code for integer value is %d

printf(“value of char is =%c\n”,c);     //0.2 indicates float value up to decimal places

printf(“value of float is =%0.2f\n”,f); //reads a character from keyboard

getch();

return 0;

}