Computer Science · C++ Programming - Access Specifiers
निम्नलिखित C++ प्रोग्राम को संकलित (compile) और निष्पादित करने पर क्या होगा? #include using namespace std; class Demo { int x; public: void set(int a) { x = a; } void display() { cout << x; } }; int main() { Demo d; d.x = 10; d.display(); }
- 1एक गारबेज वैल्यू प्रिंट होगी
- 2प्राइवेट मेंबर तक पहुँचने के कारण कंपाइलेशन एरर✓
- 3अपरिभाषित व्यवहार (Undefined behavior)
- 410 प्रिंट होगा
सही उत्तर देखें
प्राइवेट मेंबर तक पहुँचने के कारण कंपाइलेशन एरर
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on C++ Programming - Access Specifiers?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · C++ Programming - Access Specifiers