कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C++, a class that contains at least one pure virtual function is called a/an:
सही उत्तर: ग) abstract class
A class with a pure virtual function is abstract: objects of it cannot be created, but it can be used as a base class.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: string s = "abc"; reverse(s.begin(), s.end()); cout << s; ?
सही उत्तर: ख) cba
std::reverse reverses the characters of the string in place.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, struct S { int v; S(int x) : v(x) {} bool operator<(const S &o) const { return v > o.v; } };. What is printed by S a(3), b(7); cout << (a < b); ?
सही उत्तर: क) 0
The overloaded < actually returns v > o.v, i.e. 3 > 7, which is false and prints as 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, class Box has a constructor Box(int x = 2) : w(x) {} and int get() const { return w; }. What is printed by Box a, b(5); cout << a.get() + b.get(); ?
सही उत्तर: घ) 7
a uses the default argument (w = 2) and b has w = 5, so 2 + 5 = 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: int a[] = {1, 2, 3, 4}; int s = 0; for (int &x : a) { x *= 2; s += x; } cout << s << a[3]; ?
सही उत्तर: ग) 208
Through the reference each element is doubled to {2, 4, 6, 8}; s = 20 and a[3] = 8, printed as 208.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: stack<int> s; s.push(1); s.push(2); s.push(3); s.pop(); cout << s.top() << s.size(); ?
सही उत्तर: ख) 22
After popping 3, the top is 2 and two elements remain.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, struct A has void f(int) printing "A", and struct B : A declares only void f(double) printing "B". What does B b; b.f(1); print?
सही उत्तर: क) B
The f in B hides every f inherited from A (name hiding), so B::f(double) is called with 1 converted to 1.0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, struct C has static int n = 0; its default constructor does n++ and its copy constructor does n += 10. What is C::n after C a; C b = a; ?
सही उत्तर: घ) 11
C a calls the default constructor (n = 1); C b = a calls the copy constructor (n = 11).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: string s = "Hello"; s.insert(5, " World"); cout << s.find('W'); ?
सही उत्तर: ग) 6
s becomes "Hello World"; 'W' is at index 6 (counting from 0).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++ (unlike C), what is the value of sizeof('A') on a system where int is 4 bytes?
सही उत्तर: ख) 1
In C++ a character literal has type char, so sizeof('A') is 1; in C it has type int.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।