कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C++, class A prints "D" in its default constructor and "C" in its copy constructor. What is printed by: A a; A b = a; A c(b); ?
सही उत्तर: क) DCC
a uses the default constructor; both 'A b = a' and 'A c(b)' create new objects from existing ones, calling the copy constructor.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C++, given the overloads void f(int) and void f(char), which one is called by f('A')?
सही उत्तर: ग) f(char)
'A' is a char literal in C++, so f(char) is an exact match and is chosen.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
For a positive int n in C, the expression (n & (n - 1)) == 0 is true exactly when n is:
सही उत्तर: ग) a power of two
A power of two has exactly one set bit, and n - 1 flips that bit and all lower bits, so their AND is zero only for powers of two.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int k = 0, s = 0; while (k < 10) { k++; if (k % 3) continue; s += k; } printf("%d", s); ?
सही उत्तर: घ) 18
Only multiples of 3 reach s += k: 3 + 6 + 9 = 18.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On a 64-bit system, what is printed by calling f(a) for int a[10];, where void f(int a[10]) { printf("%d", (int)sizeof(a)); } ?
सही उत्तर: ख) 8
An array parameter is adjusted to a pointer (int *a), so sizeof gives the size of a pointer, 8 bytes on a 64-bit system.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does printf("%c", "Nepal"[2]); print in C?
सही उत्तर: ख) p
A string literal is a char array, so it can be indexed; index 2 of "Nepal" is 'p'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int n = 91, i, pr = 1; for (i = 2; i * i <= n; i++) if (n % i == 0) { pr = 0; break; } printf("%d %d", pr, i); ?
सही उत्तर: क) 0 7
91 = 7 x 13; the loop finds 7 as the first divisor, sets pr = 0 and breaks with i = 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: struct S { int a; int b; } s[2] = {{1, 2}, {3, 4}}; printf("%d", s[1].a + s[0].b); ?
सही उत्तर: क) 5
s[1].a is 3 and s[0].b is 2, so the sum is 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "Hello"; printf("%d", s[5]); ?
सही उत्तर: घ) 0
s has 6 elements; s[5] is the terminating null character, whose value is 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int y = 5; printf("%d", !!y); ?
सही उत्तर: क) 1
!y is 0 for non-zero y, and !0 is 1, so !! converts any non-zero value to 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।