MCQs
Size of any type of pointer is 4 on a 32-bit machine.
Output:
$ cc pgm6.c
$ a.out
p and q are 4 and 4
Since the size of the structure depends on its fields, it has a variable size.
Since the ASCII value of a is 97, the same is assigned to the float variable and printed.
Output:
$ cc pgm8.c
$ a.out
97.000000
char has lesser bytes than int and int has lesser bytes than double in any system.
Since the size of a union is the size of its maximum datatype, here int is the largest hence 4.
Output:
$ cc pgm7.c
$ a.out
4
The ASCII value of 5 is 53, the char type-casted integral value 5 is 5 only.
Output:
$ cc pgm1.c
$ a.out
FAILED
FAILED
FAILED
FAILED
FAILED
65000 comes in the range of short (16-bit) which occupies the least memory.
Both %d and %i can be used as a format identifier for int data type.
typedef and struct are used to define user-defined data types.
The size of the data types depend on the system.