j

Monday, 2 November 2015

Write a program that displays the sizes of different data types

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"Size of char = "<<sizeof(char)<<endl;
cout<<"Size of int = "<<sizeof(int)<<endl;
cout<<"Size of unsigned int = "<<sizeof(unsigned int)<<endl;
cout<<"Size of short int = "<<sizeof(short int)<<endl;
cout<<"Size of long int = "<<sizeof(long int)<<endl;
cout<<"Size of unsigend long int = "<<sizeof(unsigned long int)<<endl;
cout<<"Size of float = "<<sizeof(float)<<endl;
cout<<"Size of double = "<<sizeof(double)<<endl;
cout<<"Size of long double = "<<sizeof(long double)<<endl;
getch();

}


Subscribe to this Blog via Email :