Q. Predict the output of following C++ program.

Code:
#include<iostream>
using namespace std;
class Empty {};
int main() {
cout << sizeof(Empty);
return 0;
}
  • (A) 0
  • (B) A non-zero value
  • (C) Runtime Error
  • (D) Compiler Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) A non-zero value

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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