fork download
  1. #include <stdio.h>
  2. #include <limits.h>
  3. #include <float.h>
  4.  
  5. int main() {
  6. printf ("C Data Types and Memory Usage:\n");
  7.  
  8. printf("char: size=%lu bytes, min=%d, max=%d\n", sizeof(char),
  9. CHAR_MIN, CHAR_MAX);
  10.  
  11. printf("int: size=%lu bytes, min=%d, max=%d\n", sizeof(int),
  12. INT_MIN, INT_MAX);
  13.  
  14. printf("float: size=%lu bytes, min=%e, max=ke\n", sizeof(float),
  15. FLT_MIN, FLT_MAX);
  16.  
  17. printf("double: size=%lu bytes, min=%e, max=%e\n", sizeof(double),
  18. DBL_MIN, DBL_MAX);
  19.  
  20.  
  21. return 0;
  22.  
  23. }
  24.  
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
C Data Types and Memory Usage:
char: size=1 bytes, min=-128, max=127
int: size=4 bytes, min=-2147483648, max=2147483647
float: size=4 bytes, min=1.175494e-38, max=ke
double: size=8 bytes, min=2.225074e-308, max=1.797693e+308