qfedu-c-level/day4/homework/h2.c

22 lines
493 B
C
Raw Permalink Normal View History

2023-07-08 16:27:14 +08:00
#include <stdio.h>
int main()
{
char a = 'a';
short b = 12;
int c = 34;
unsigned int d = 43;
long int e = 232;
float f = 1.23f;
double g = 12.32;
printf("sizeof a = %ld\n", sizeof(a));
printf("sizeof b = %ld\n", sizeof(b));
printf("sizeof c = %ld\n", sizeof(c));
printf("sizeof d = %ld\n", sizeof(d));
printf("sizeof e = %ld\n", sizeof(e));
printf("sizeof f = %ld\n", sizeof(f));
printf("sizeof g = %ld\n", sizeof(g));
return 0;
}