-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsizeof.c
More file actions
35 lines (24 loc) · 901 Bytes
/
sizeof.c
File metadata and controls
35 lines (24 loc) · 901 Bytes
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
#include <stdio.h>
/* program to show the use of the sizeof() function*/
void main(void) {
char c;
unsigned char uc;
signed char sc;
int i;
unsigned int ui;
signed int si;
short int shi;
long int li;
float f;
double d;
long long ll;
printf("The size of a char is %d bytes\n", sizeof(c));
printf("The size of an unsigned char is %d bytes\n", sizeof(uc));
printf("The size of a signed char is %d bytes\n", sizeof(sc));
printf("The size of an int is %d bytes\n", sizeof(i));
printf("The size of a short int is %d bytes\n", sizeof(shi));
printf("The size of a long int is %d bytes\n", sizeof(li));
printf("The size of a float is %d bytes\n", sizeof(f));
printf("The size of a double is %d bytes\n", sizeof(d));
printf("The size of a long long is %d bytes\n", sizeof(ll));
}