कम्प्युटर / सूचना प्रविधि कम्प्युटर अधिकृत (सातौँ तह) – प्राविधिक पत्र
कम्प्युटर / सूचना प्रविधि – कम्प्युटर अधिकृत (सातौँ तह)
Computer Officer – 7th Level · Computer & IT Posts
२,५७७ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्राविधिक पत्र: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ५ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What does the following C code print? int f = 8; f |= 1 << 0; f ^= 1 << 3; printf("%d", f);
सही उत्तर: ख) 1
8 | 1 = 9 (binary 1001); XOR with 8 (1000) clears bit 3, leaving 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? printf("%d", (13 >> 2) & 1);
सही उत्तर: क) 1
13 is binary 1101; shifting right by 2 gives 11 (3), and 3 & 1 = 1, so bit 2 of 13 is set.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? int a = 3; a = a * a + a / a - a % a; printf("%d", a);
सही उत्तर: घ) 10
a*a = 9, a/a = 1 and a%a = 0, so 9 + 1 - 0 = 10.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? char c = 'z'; c = (c - 'a' + 3) % 26 + 'a'; printf("%c", c);
सही उत्तर: घ) c
'z' - 'a' = 25; (25 + 3) % 26 = 2, and 'a' + 2 = 'c' (a Caesar shift that wraps round).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? int n = 6, s = 0; while (n) s += n--; printf("%d", s);
सही उत्तर: ग) 21
s = 6 + 5 + 4 + 3 + 2 + 1 = 21; the loop stops when n becomes 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? int i = 0; for (;;) { if (i++ == 3) break; } printf("%d", i);
सही उत्तर: क) 4
When i is 3 the comparison is true, but the post-increment still makes i 4 before break.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int f(int n) { if (n <= 0) return 1; return f(n - 1) + f(n - 2); }, what does printf("%d", f(4)); print?
सही उत्तर: ख) 8
f(0) = f(-1) = 1, f(1) = 2, f(2) = 3, f(3) = 5, f(4) = 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int f(int a, int b) { return a < b ? 0 : 1 + f(a - b, b); }, what does printf("%d", f(17, 5)); print?
सही उत्तर: ख) 3
The function counts how many times 5 can be subtracted from 17 (17, 12, 7, then 2 < 5), which is integer division: 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? int i, j; for (i = 0, j = 0; i < 5; i++) j += i * i; printf("%d", j);
सही उत्तर: घ) 30
j = 0 + 1 + 4 + 9 + 16 = 30.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? char g = 'B'; switch (g) { case 'A': printf("Excellent"); break; case 'B': case 'C': printf("Good"); break; default: printf("Fail"); }
सही उत्तर: ग) Good
Case 'B' has no statements and falls through to case 'C', which prints Good and then breaks.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।