Question: What will be output when you will execute following c code?#include<stdio.h>
int main(){
printf("%d\t",sizeof(6.5));
printf("%d\t",sizeof(90000));
printf("%d",sizeof('A'));
return 0;
}
A
B
C
D
4 2 1
B
8 2 1
C
4 4 1
D
8 4 2
Note: By default data type of numeric constants is:
6.5 : double
90000: long int
'A': char
In C size of data type varies from compiler to compiler.
In TURBO C 3.0 (16 bit compilers) size of:
double is 8 byte
Long int is 4 byte
Character constant is 2 byte (size of char data type is one byte)
In TURBO C 4.5 or Linux GCC compilers (32 bit compilers) size of:
double is 8 byte
long int is 8 byte
Character constant is 2 byte