finding the size of a data type.


SUBMITTED BY: Nrupeshsinh

DATE: June 22, 2016, 11:48 a.m.

FORMAT: Text only

SIZE: 375 Bytes

HITS: 652

  1. # include<iostream.h>
  2. # include<conio.h>
  3. void main()
  4. {
  5. int a;
  6. long int b;
  7. float c;
  8. double d;
  9. char e;
  10. clrscr();
  11. cout<<"1) Size of Int :"<<sizeof(a)<<endl;
  12. cout<<"2) Size of long int :"<<sizeof(b)<<endl;
  13. cout<<"3) Size of float :"<<sizeof(c)<<endl;
  14. cout<<"4) Size of Double :"<<sizeof(d)<<endl;
  15. cout<<"5) Size of char :"<<sizeof(e)<<endl;
  16. getch();
  17. }

comments powered by Disqus