Advertisement
Tahamina_Taha

The size of a variable using the sizeof() operator.

Aug 17th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. //the size of a variable using the sizeof() operator.
  4. {
  5.     int i ;
  6.     char c;
  7.     double d;
  8.     float f;
  9.     long l;
  10.  
  11.     printf("size of integer  = %d bytes\n", sizeof(i));
  12.     printf("size of character  = %d bytes\n", sizeof(c));
  13.     printf("size of double  = %d bytes\n", sizeof(d));
  14.     printf("size of float  = %d bytes\n", sizeof(f));
  15.     printf("size of long  = %d bytes\n", sizeof(l));
  16.  
  17.  
  18.     return 0;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement