61
GB
What is the output: class A{int x=0; public: int get()const{return x;} void set(int v){x=(v>0?v:x);}}; A a; a.set(-1); a.set(5); cout<
IN
आउटपुट क्या है: class A{int x=0; सार्वजनिक: int get()const{return x;} void set(int v){x=(v>0?v:x);}}; ए ए; ए.सेट(-1); ए.सेट(5); अदालत
A
5
5
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
-1 rejected; 5 accepted. x=5. Output: 5.
व्याख्या (हिन्दी)
-1 अस्वीकृत; 5 स्वीकृत. एक्स=5. आउटपुट: 5.