πŸ“Š C++
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) The output in C is 1 and in C++ is 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
211
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
97%
Success Rate