OOP Using C++ — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 106 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
106 questions
106
EN + हिं
GB What is the output: class A{public:int x; A(int v):x(v){} A& operator++(){++x;return *this;} A operator++(int){A t=*this;++x;return t;}}; A a(5); cout<<(a++).x<
IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){} A& ऑपरेटर++(){++x;रिटर्न *यह;} ए ऑपरेटर++(int){A t=*this;++x;रिटर्न t;}}; ए ए(5); अदालत
A
577 577
B
567 567
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a++=5(a=6); a.x=6; ++a: a=7, returns 7. Output: 567.
व्याख्या (हिन्दी) ए++=5(ए=6); a.x=6; ++a: a=7, रिटर्न 7. आउटपुट: 567.
106–106 of 106