C - Print the range of values for certain data types Code Example

The code for Print the range of values for certain data types

#include <stdio.h>
#include <limits.h>
#include <float.h>

int main(void) {
  printf("Integer: %d, %d\n", INT_MIN, INT_MAX);
  printf("Long: %ld, %ld\n", LONG_MIN, LONG_MAX);
  printf("Float: %e, %e\n", FLT_MIN, FLT_MAX);
  printf("Double: %e, %e\n", DBL_MIN, DBL_MAX);
  printf("Long double: %e, %e\n", LDBL_MIN, LDBL_MAX);
  printf("Float-Double epsilon:, %e, %e\n", FLT_EPSILON, DBL_EPSILON);
  
  return 0;
}

/*
Output:
Integer: -2147483648, 2147483647
Long: -9223372036854775808, 9223372036854775807
Float: 1.175494e-38, 3.402823e+38
Double: 2.225074e-308, 1.797693e+308
Long double: 0.000000e+00, 0.000000e+00
Float-Double epsilon:, 1.192093e-07, 2.220446e-16
*/
Code by IncludeHelp, on August 12, 2022 08:37

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.