fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int intType;
  5. float floatType;
  6. double doubleType;
  7. char charType;
  8. // sizeof evaluates the size of a variable
  9. printf("Size of int %zu bytes\n",sizeof(intType)) ;
  10. printf("Size of float %zu bytes\n",sizeof(floatType)) ;
  11. printf("Size of double %zu bytes\n",sizeof(doubleType)) ;
  12. printf("Size of char %zu bytes\n",sizeof(charType)) ;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Size of int 4 bytes
Size of float 4 bytes
Size of double 8 bytes
Size of char 1 bytes