By 26/03/2014 12 Comments

Exercise Program # 03 Operators in C++

Q: Write a program that calculates the memory size of variable of different data type?


#include <iostream.h>  
#include <conio.h>

void main()
     char a;
     short b;
     int c;
     long d;
     float e;
     double f;
     long double g;

     cout<<"Size of a: "<<sizeof(a)<<" byte"<<endl;     
     cout<<"Size of b: "<<sizeof(b)<<" bytes"<<endl;  
     cout<<"Size of c: "<<sizeof(c)<<" bytes"<<endl;     
     cout<<"Size of d: "<<sizeof(d)<<" bytes"<<endl;     
     cout<<"Size of e: "<<sizeof(e)<<" bytes"<<endl;     
     cout<<"Size of f: "<<sizeof(f)<<" bytes"<<endl;     
     cout<<"Size of g: "<<sizeof(g)<<" bytes";     


Posted in: C++ Exercises

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .