Question
#include<stdio.h>
void main()
{
printf("%d",sizeof(5.2));
}
What is the output of the following program?
#include<stdio.h>
void main()
{
printf("%d",sizeof(5.2));
}
Answer: Option C
Was this answer helpful ?
The default type for decimal constants is double and not float.
Hence the value 5.2 is treated as a double and 8 is printed.
Was this answer helpful ?
Submit Solution