What will be the output of the following program in both C and C++?
#include<stdio.h>
int main(int argc, char const *argv[])
{
printf("%d\n", (int)sizeof('a'));
return 0;
}
#include<stdio.h>
int main(int argc, char const *argv[])
{
printf("%d\n", (int)sizeof('a'));
return 0;
}
A. Output in C is 1 and in C++ is 4
B. Output in C is 4 and in C++ is 1
C. Output in C is 1 and in C++ is 1
D. Output in C is 4 and in C++ is 4
Answer: Option B
Join The Discussion