C   75

size of long

Guest on 14th July 2022 02:10:48 AM

  1. // see Bb --> headerfiles links to see what these libraries mean.
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <limits.h>
  5. #include <float.h>
  6.  
  7. int main(int argc, char* argv[]){
  8.   printf("The size of int is %d bytes \n", sizeof(int));
  9.   printf("The size of char is %d bytes \n", sizeof(char));
  10.   printf("The size of long is %d bytes \n", sizeof(long));
  11.   // exercise: try writing code for sizes of other data types
  12.   printf("the maximum number that can be represented by int is %ld \n", INT_MAX);
  13.   printf("the maximum number that can be represented by double is %ld \n", DBL_MAX);
  14.   return EXIT_SUCCESS;
  15. }
  16.  
  17. /* question: For each of the functions and constants above, printf, sizeof
  18.              INT_MAX, DBL_MAX indicate which header file they are defined.
  19.                          */

Raw Paste


Login or Register to edit or fork this paste. It's free.