कम्प्युटर / सूचना प्रविधि कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक – प्राविधिक पत्र
कम्प्युटर / सूचना प्रविधि – कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक
Computer Operator & Assistant · Computer & IT Posts
२,५७७ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्राविधिक पत्र: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ५ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C++, class A has a default constructor and a copy constructor that prints "C". Given void f(A a) {}, what is printed by A a; f(a); f(a); ?
सही उत्तर: ग) CC
Passing an object by value copies it, so the copy constructor runs once for each call.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: try { throw 5; } catch (double d) { cout << "D"; } catch (int i) { cout << "I" << i; } ?
सही उत्तर: क) I5
An int exception is not converted to double when matching handlers, so it is caught by catch (int i).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: map<int, int> m; m[3] = 1; m[1] = 2; m[2] = 3; for (auto &p : m) cout << p.second; ?
सही उत्तर: घ) 231
std::map iterates in increasing key order (1, 2, 3), whose values are 2, 3 and 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: string s = "Kathmandu"; cout << s.length() - s.find("man"); ?
सही उत्तर: घ) 5
The length is 9 and "man" starts at index 4, so 9 - 4 = 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: vector<int> v{3, 1, 4, 1, 5}; cout << count(v.begin(), v.end(), 1) << *max_element(v.begin(), v.end()); ?
सही उत्तर: घ) 25
count finds two 1s, and max_element returns an iterator to 5, so the output is 25.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given template <typename T> T sum(T a, T b) { return a + b; }, what is printed by cout << sum(2, 3) << sum(2.5, 1.5); ?
सही उत्तर: ग) 54
sum<int> gives 5; sum<double> gives 4.0, which cout prints as 4 by default, so the output is 54.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given struct C { int v; C& operator++() { v += 2; return *this; } };, what is printed by C c{1}; ++c; ++c; cout << c.v; ?
सही उत्तर: ख) 5
The overloaded prefix ++ adds 2 each time: 1 + 2 + 2 = 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given void f(int x, int &y) { x++; y++; } and int a = 1, b = 1;, what is printed by f(a, b); cout << a << b; ?
सही उत्तर: ग) 12
x is a copy of a, so a stays 1; y is a reference to b, so b becomes 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, class Base's destructor prints "1", class M's destructor prints "3", and class Derived : public Base has a data member of type M and a destructor that prints "2". What is printed when a Derived object goes out of scope?
सही उत्तर: क) 231
Destruction is the reverse of construction: the Derived destructor body runs first, then its members are destroyed, then the base class.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, class A prints "A" in its constructor, and class B has a data member of type A and prints "B" in its own constructor. What is printed by the declaration B b; ?
सही उत्तर: क) AB
Member objects are constructed before the body of the containing class's constructor runs, so A appears first.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।