1801 Question 1801 EN + हिं GB What is the output: class A{int x=0; public:int get()const{return x;} void f(){x++;} void g(){f();f();f();}}; A a; a.g(); cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक:int get()const{return x;} void f(){x++;} void g(){f();f();f();}}; ए ए; a.g(); अदालत A 3 3 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) g() calls f() 3 times: x=3. Output: 3. व्याख्या (हिन्दी) g() f() को 3 बार कॉल करता है: x=3। आउटपुट: 3. 🎯 Exam Perspective OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{int x=0; public:A& operator What is the output: class Acc{double s=0,n=0; public:vo... What is the output: class A{int n; public:A(int v):n(v)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1802 Question 1802 EN + हिं GB What is the output: class A{int n; public:A(int v):n(v){} auto begin(){return &n;} auto end(){return &n+1;}}; A a(42); for(int x:a) cout< IN आउटपुट क्या है: class A{int n; सार्वजनिक:ए(int v):n(v){} ऑटो प्रारंभ(){रिटर्न &n;} ऑटो एंड(){रिटर्न &n+1;}}; ए ए(42); for(int x:a) कोउट A 42 42 B Compile error संकलन त्रुटि C Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Iterates single element 42. Output: 42. व्याख्या (हिन्दी) एकल तत्व को पुनरावृत्त करता है 42. आउटपुट: 42. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{int x=0; public:void set(in... What is the output: class A{int x; public:explicit A(in... What is the output: class A{int x=5; public:const int&... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1803 Question 1803 EN + हिं GB What is the output: class A{int x; public:A(int v):x(v){} int operator()(int y)const{return x*y;} int operator()(int y,int z)const{return x*(y+z);}}; A a(3); cout< IN आउटपुट क्या है: class A{int x; सार्वजनिक:ए(int v):x(v){} int ऑपरेटर()(int y)const{रिटर्न x*y;} int ऑपरेटर()(int y,int z)const{रिटर्न x*(y+z);}}; ए ए(3); अदालत A 1227 1227 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 12 27 12 27 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a(4)=3*4=12; a(4,5)=3*9=27. Output: 1227. व्याख्या (हिन्दी) ए(4)=3*4=12; a(4,5)=3*9=27. आउटपुट: 1227. 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x; public:explicit A(in... What is the output: class A{int x=0; public:int get()co... What is the output: class A{int n=0; public:void add(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1804 Question 1804 EN + हिं GB What is the output: class A{int x=0; public:A& inc(){x++;return *this;} A& mul(int n){x*=n;return *this;} int val()const{return x;}}; A a; cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक:A& inc(){x++;return *this;} A& mul(int n){x*=n;return *this;} int val()const{return x;}}; ए ए; अदालत A 9 9 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 0+1+1+1=3; 3*3=9. Output: 9. व्याख्या (हिन्दी) 0+1+1+1=3; 3*3=9. आउटपुट: 9. 🎯 Exam Perspective OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int n=0; public:void add(in... What is the output: class A{int x=0; public:void set(in... What is the output: class A{int x; public:A(int v):x(v)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1805 Question 1805 EN + हिं GB What is the output: class A{int x; public:explicit A(int v):x(v){} A operator-()const{return A(-x);} int get()const{return x;}}; A a(5); A b=-a; cout< IN आउटपुट क्या है: class A{int x; सार्वजनिक:स्पष्ट A(int v):x(v){} A ऑपरेटर-()const{return A(-x);} int get()const{return x;}}; ए ए(5); ए बी=-ए; अदालत A -5 -5 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) -a: operator-() returns A(-5). b.get()=-5. Output: -5. व्याख्या (हिन्दी) -ए: ऑपरेटर-() रिटर्न ए(-5)। बी.प्राप्त()=-5. आउटपुट:-5. 🎯 Exam Perspective यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x=5; public:const int&... What is the output: class A{int n; public:A(int v):n(v)... What is the output: class A{string name_; public:A(stri... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1806 Question 1806 EN + हिं GB What is the output: class Stack{vectors; public:void push(int x){s.push_back(x);} int top()const{return s.back();} void pop(){s.pop_back();} bool empty()const{return s.empty();} int size()const{return s.size();}}; Stack st; st.push(1);st.push(2);st.push(3); cout< IN आउटपुट क्या है: क्लास स्टैक {वेक्टर; सार्वजनिक: शून्य पुश (इंट एक्स) {एस पुश_बैक (एक्स); ढेर सेंट; st.push(1);st.push(2);st.push(3); अदालत A 332 332 B 123 123 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) top=3,size=3; pop; top=2. Output: 332. व्याख्या (हिन्दी) शीर्ष=3,आकार=3; जल्दी से आना; शीर्ष=2. आउटपुट: 332. 🎯 Exam Perspective यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{int x=0; public:A& operator What is the output: class A{int x=0; public:A& inc(){x+... What is the output: class A{int x; public:explicit A(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1807 Question 1807 EN + हिं GB What is the output: class A{int x=0; public:void set(int v){x=v%10;} int get()const{return x;}}; A a; a.set(42); cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक:शून्य सेट(int v){x=v%10;} int get()const{return x;}}; ए ए; ए.सेट(42); अदालत A 2 2 B 42 42 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 42%10=2. Output: 2. व्याख्या (हिन्दी) 42%10=2. आउटपुट: 2. 🎯 Exam Perspective OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{int x=0; public:A& inc(){x+... What is the output: class A{int x; public:A(int v):x(v)... What is the output: class A{int x; public:explicit A(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1808 Question 1808 EN + हिं GB What is the output: class A{int x; public:A(int v):x(v){} int get()const{return x;} bool operator>(const A& o)const{return x>o.x;}}; vectorv={{5},{3},{8},{1}}; cout<<(*max_element(v.begin(),v.end())).get(); IN आउटपुट क्या है: class A{int x; public:A(int v):x(v){} int get()const{return x;} bool operator>(const A& o)const{return x>o.x;}}; वेक्टरv={{5},{3},{8},{1}}; अदालत A Compile error संकलन त्रुटि B 8 8 C 5 5 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) max_element uses operator<, not >. Need operator<. Compile error if only operator> defined. Actually max_element uses operator< by default. Compile error. व्याख्या (हिन्दी) max_element ऑपरेटर का उपयोग करता है। ऑपरेटर परिभाषित की आवश्यकता है. दरअसल max_element डिफ़ॉल्ट रूप से ऑपरेटर< का उपयोग करता है। संकलन त्रुटि. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{int x; public:A(int v):x(v)... What is the output: class A{int x; public:explicit A(in... What is the output: class A{int x=0; public:int get()co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1809 Question 1809 EN + हिं GB What is the output: class A{int x=0; public:A& operator<<(int v){x+=v;return *this;} int get()const{return x;}}; A a; a<<1<<2<<3<<4<<5; cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक:ए एवं ऑपरेटर A 15 15 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 0+1+2+3+4+5=15. Output: 15. व्याख्या (हिन्दी) 0+1+2+3+4+5=15. आउटपुट: 15. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class Stack{vectors; public:void pu... What is the output: class A{int x=0; public:int get()co... What is the output: class A{int x,y; public:A(int a,int... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1810 Question 1810 EN + हिं GB What is the output: class A{int x; public:explicit A(int v):x(v){} int get()const{return x;} A& operator++(){++x;return *this;} A operator++(int){auto t=*this;++*this;return t;}}; A a(3); cout<<(a++).get()< IN आउटपुट क्या है: class A{int x; सार्वजनिक:स्पष्ट A(int v):x(v){} int get()const{return x;} A& ऑपरेटर++(){++x;रिटर्न *यह;} A ऑपरेटर++(int){auto t=*this;++*this;रिटर्न t;}}; ए ए(3); अदालत A 345 345 B 344 344 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a++=3(a=4); a.get()=4; ++a=5. Output: 345. व्याख्या (हिन्दी) ए++=3(ए=4); a.get()=4; ++ए=5. आउटपुट: 345. 🎯 Exam Perspective OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x=5; public:const int&... What is the output: class Stack{vectors; public:void pu... What is the output: class A{int x,y; public:A(int a,int... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1811 Question 1811 EN + हिं GB What is the output: class A{string name_; public:A(string n):name_(n){} const string& name()const{return name_;} bool operator==(const A& o)const{return name_==o.name_;}}; A a("Bob"),b("Bob"),c("Alice"); cout<<(a==b)<<(a==c); IN आउटपुट क्या है: क्लास ए{स्ट्रिंग नाम_; सार्वजनिक:ए(स्ट्रिंग एन):नाम_(एन){} स्थिरांक स्ट्रिंग&नाम()स्थिरांक{वापसी नाम_;} बूल ऑपरेटर==(स्थिरांक ए&ओ)स्थिरांक{वापसी नाम_==ओ.नाम_;}}; ए ए("बॉब"),बी("बॉब"),सी("ऐलिस"); अदालत A 10 10 B 01 01 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Bob==Bob=1; Bob==Alice=0. Output: 10. व्याख्या (हिन्दी) बॉब==बॉब=1; बॉब==ऐलिस=0. आउटपुट: 10. 🎯 Exam Perspective यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x=0; public:int get()co... What is the output: class A{int x=0; public:A& inc(){x+... What is the output: class A{int x; public:A(int v):x(v)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1812 Question 1812 EN + हिं GB What is the output: class A{int n=0; public:void add(int x){n+=x;} void sub(int x){n-=x;} void neg(){n=-n;} int get()const{return n;}}; A a; a.add(5);a.add(3);a.neg();a.sub(2); cout< IN आउटपुट क्या है: class A{int n=0; सार्वजनिक: शून्य जोड़ें (int x) {n + = x;} शून्य उप (int x) {n- = x;} शून्य नकारात्मक() {n = - n;} int get() स्थिरांक {वापसी n;}}; ए ए; a.add(5);a.add(3);a.neg();a.sub(2); अदालत A -10 -10 B -8 -8 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 0+5+3=8; neg=-8; -8-2=-10. Output: -10. व्याख्या (हिन्दी) 0+5+3=8; नकारात्मक=-8; -8-2=-10. आउटपुट:-10. 🎯 Exam Perspective यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{int n; public:A(int v):n(v)... What is the output: class A{int x=5; public:const int&... What is the output: class A{int x=0; public:void set(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1813 Question 1813 EN + हिं GB What is the output: class A{int x,y; public:A(int a,int b):x(a),y(b){} A scale(int n)const{return {x*n,y*n};} int mag2()const{return x*x+y*y;}}; A a(3,4); cout< IN आउटपुट क्या है: class A{int x,y; सार्वजनिक:ए(int a,int b):x(a),y(b){} A स्केल(int n)const{return {x*n,y*n};} intmag2()const{return x*x+y*y;}}; ए ए(3,4); अदालत A 100 100 B 25 25 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) scale(2)=(6,8); mag2=36+64=100. Output: 100. व्याख्या (हिन्दी) स्केल(2)=(6,8); Mag2=36+64=100. आउटपुट: 100. 🎯 Exam Perspective OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{int x=0; public:void set(in... What is the output: class A{int x=5; public:const int&... What is the output: class A{int x; public:explicit A(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1814 Question 1814 EN + हिं GB What is the output: class A{int x=5; public:const int& cref()const{return x;} int& ref(){return x;}}; A a; a.ref()=10; cout< IN आउटपुट क्या है: class A{int x=5; सार्वजनिक:const int& cref()const{return x;} int& ref(){return x;}}; ए ए; a.ref()=10; अदालत A 10 10 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) ref()=x=10; cref()=10. Output: 10. व्याख्या (हिन्दी) रेफरी()=x=10; क्रेफ़()=10. आउटपुट: 10. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{int n=0; public:void add(in... What is the output: class A{int x; public:explicit A(in... What is the output: class A{int n; public:A(int v):n(v)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
1815 Question 1815 EN + हिं GB What is the output: class Acc{double s=0,n=0; public:void add(double x){s+=x;n++;} double mean()const{return n?s/n:0;}}; Acc acc; acc.add(2);acc.add(4);acc.add(6); cout< IN आउटपुट क्या है: class Acc{double s=0,n=0; सार्वजनिक:शून्य जोड़ें(डबल x){s+=x;n++;} डबल माध्य()const{रिटर्न n?s/n:0;}}; एसीसी एसीसी; acc.add(2);acc.add(4);acc.add(6); अदालत A 4 4 B 6 6 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) (2+4+6)/3=4. Output: 4. व्याख्या (हिन्दी) (2+4+6)/3=4. आउटपुट: 4. 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x=5; public:const int&... What is the output: class A{int x; public:explicit A(in... What is the output: class A{int n=0; public:void add(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)