कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C++ code: map<char, int> m; for (char c : string("banana")) m[c]++; cout << m['a'] << m.size(); ?
सही उत्तर: क) 33
'a' occurs 3 times, and the map has 3 distinct keys (a, b, n).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: vector<int> v = {5, 3, 8, 1}; sort(v.begin(), v.end()); cout << v[1] << v.back(); ?
सही उत्तर: घ) 38
After sorting, v = {1, 3, 5, 8}; v[1] = 3 and v.back() = 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, B has a virtual destructor printing "B", and D : B has a destructor printing "D". What is printed by: B *p = new D; delete p; ?
सही उत्तर: ग) DB
Because the base destructor is virtual, the derived destructor runs first, then the base destructor: DB.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, class A prints "1" in its constructor and "2" in its destructor. What is printed by main() { A *p = new A; delete p; A x; } ?
सही उत्तर: ख) 1212
new A prints 1, delete p prints 2, A x prints 1, and x is destroyed at the end of main printing 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C++ code: int a = 5; int &r = a; int b = r; b++; cout << a << b; ?
सही उत्तर: क) 56
b is an ordinary int copied from r (that is, from a), so incrementing b does not change a: 5 and 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
When a continue statement is executed inside a C do-while loop, control passes to:
सही उत्तर: घ) the evaluation of the loop condition
In a do-while loop, continue skips the rest of the body and jumps to the test of the while condition.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C standard library function converts a string such as "3.75" into a double value?
सही उत्तर: ग) atof()
atof() (declared in stdlib.h) converts a string to double; atoi() converts to int, while itoa() and ftoa() are not standard C.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
To use the strlen() and strcpy() functions in a C program, which header file should be included?
सही उत्तर: ख) string.h
The string-handling functions such as strlen(), strcpy() and strcmp() are declared in string.h.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C standard library function reads formatted data from a character string (rather than from the keyboard)?
सही उत्तर: ख) sscanf()
sscanf() works like scanf() but takes its input from a string; sprintf() writes formatted output into a string.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int n = 5, i; for (i = 0; i < n; i++) n--; printf("%d %d", i, n); ?
सही उत्तर: घ) 3 2
Checks: 0 < 5 (n becomes 4), 1 < 4 (n = 3), 2 < 3 (n = 2), then 3 < 2 fails, so 3 2 is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।