MCQs > IT & Programming > C++ > Answer the question that follows. 1 class Car 2 { 3 private: 4 int Wheels; 5 6 public: 7 Car(int wheels = 0) 8 : Wheels(wheels) 9 { 10 } 11 12 int GetWheels() 13 { 14 return Wheels; 15 } 16 }; 17 main() 18 { 19 Car c(4); 20 cout << 'No of wheels:' << c.GetWheels(); 21 } Which of the following lines from the sample code above are examples of data member definition?

C++ MCQs

Consider the sample code given below and answer the question that
follows.
1 class Car
2 {
3 private:
4 int Wheels;
5
6 public:
7 Car(int wheels = 0)
8 : Wheels(wheels)
9 {
10 }
11
12 int GetWheels()
13 {
14 return Wheels;
15 }
16 };
17 main()
18 {
19 Car c(4);
20 cout << "No of wheels:" << c.GetWheels();
21 }
Which of the following lines from the sample code above are examples of
data member definition?

Answer

Correct Answer: 4

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it