Quiz: Classes and Inheritance
Test your understanding of classes and inheritance in C++.
1
What is the output of the code below?
#include <iostream>
using namespace std;
class Score {
int x;
};
int main()
{
Score sc;
cout << sc.x;
return 0;
}
A)
0
B)
Garbage value
C)
Compiler error
D)
Run time error
Question 1 of 50 attempted
Create a free account to access the full course.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy