Question
What is the output of this C code?
int main()
{
float x = 'a';
printf("%f", x);
return 0;
}
int main()
{
float x = 'a';
printf("%f", x);
return 0;
}
Answer: Option D
Was this answer helpful ?
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
Was this answer helpful ?
Submit Solution