-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathranges.c
45 lines (35 loc) · 890 Bytes
/
ranges.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Prints ranges of data types in C
*/
#include <stdio.h>
#include <limits.h>
int main()
{
printf("\n\nThis Computer Supports the following\n");
printf("Datatype specifications:\n\n");
int i = sizeof(int);
printf("Size of Int: %d\n", i);
printf("INT_MIN: %d\n", INT_MIN);
printf("INT_MAX: %d\n", INT_MAX);
printf("\n");
i = sizeof(char);
printf("Size of Char: %d\n", i);
printf("CHAR_BIT: %d\n", CHAR_BIT);
printf("CHAR_MAX: %d\n", CHAR_MAX);
printf("CHAR_MIN: %d\n", CHAR_MIN);
printf("\n");
i = sizeof(double);
printf("Size of Double: %d\n", i);
printf("\n");
i = sizeof(long);
printf("Size of Long: %d\n", i);
printf("LONG_MIN: %ld\n", LONG_MIN);
printf("LONG_MAX: %ld\n", LONG_MAX);
printf("\n");
i = sizeof(short);
printf("Size of Short: %d\n", i);
printf("SHRT_MIN: %d\n", SHRT_MIN);
printf("SHRT_MAX: %d\n", SHRT_MAX);
printf("\n");
return 0;
}