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. // Correct the printf and fix the constant typo
  9. printf("char: size = %lu bytes, min = %d, max = %d\n", sizeof(char), CHAR_MIN, CHAR_MAX);
  10.  
  11. printf("int: size = %lu bytes, min = %d, max = %d\n", sizeof(int), INT_MIN, INT_MAX);
  12.  
  13. printf("float: size = %lu bytes, min = %e, max = %e\n", sizeof(float), FLT_MIN, FLT_MAX);
  14.  
  15. printf("double: size = %lu bytes, min = %e, max = %e\n", sizeof(double), DBL_MIN, DBL_MAX);
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5308KB
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 = 3.402823e+38
double: size = 8 bytes, min = 2.225074e-308, max = 1.797693e+308