Q. What happens if the following program is run in C and C++?
Code:
#include<stdio.h>
int main()
{
char x = 'x';
printf("%d\n", (int)sizeof(x));
return 0;
}
β
Correct Answer: (B)
The output in C is 1 and in C++ is 1