Page 1 of 1

What will be the output of the following program in both C and C++?

Posted: Wed Jul 13, 2022 7:51 pm
by answerhappygod
#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