Wednesday, 5 December 2012

CPL PROGRAM 9 CODING

                    BASIC USAGE OF DATATYPES FORMATS SPECIFIER

CODING:
                        
#include<stdio.h>
#include<conio.h>
void main()
{
 int a;
 char b;
 float c;
 double d;
 short int e;
 long int f;
 short char g;
 unsigned int h;
 unsigned char i;
 clrscr();
 printf("\n \t size ot the integer variable is %d",sizeof(a));
 printf("\n \t size ot the character variable is %c",sizeof(b));
 printf("\n \t size ot the float variable is %f",sizeof(c));
 printf("\n \t size ot the double variable is %f",sizeof(d));
 printf("\n \t size ot the short int variable is %d",sizeof(e));
 printf("\n \t size ot the long int variable is %ld",sizeof(f));
 printf("\n \t size ot the short char variable is %c",sizeof(g));
 printf("\n \t size ot the unsigned integer variable is %d",sizeof(h));
 printf("\n \t size ot the unsigned char variable is %c",sizeof(i));
 getch();
}

No comments:

Post a Comment