Use Of SIZEOF() Operator In C/C++.
#include<iostream>
using namespace std;
int main()
{
int a;
char ch;
float m;
double n;
long d;
short b;
cout<<"Size of integer is:"<<sizeof(a)<<endl;
cout<<"Size of character is:"<< sizeof(ch)<<endl;
cout<<"Size of float is:"<<sizeof(m)<<endl;
cout<<"Size of double is:"<<sizeof(n)<<endl;
cout<<"Size of long integer is:"<<sizeof(d)<<endl;
cout<<"Size of short integer is:"<<sizeof(b)<<endl;
return 0;
}
0 Comments