R

Ram Sharma • 193.86K Points
Coach

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;
}
  • (A) The output in C is 4 and in C++ is 4
  • (B) The output in C is 1 and in C++ is 1
  • (C) The output in C is 4 and in C++ is 1
  • (D) The output in C is 1 and in C++ is 4
  • Correct Answer - Option(B)
  • Views: 117
  • Filed under category C++

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics