why value a and x is different? I think it should be the same
a is an int and x is a pointer.
int a = 5;
int *x = &a;
C does not specifier an int and a pointer need to be the same size. They may have the same size. Commonly a pointer is as wide as an int or wider, yet either one may be wider than the other.
It is implementation defined.
Since C99, use "%zu" to print a size_t, which is the resultant type from sizeof.
// printf("%ld\n", sizeof(a));
printf("%zu\n", sizeof(a));
// or
printf("%zu\n", sizeof a); // () not needed about objects.