कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Given void f(int n) { if (n > 0) { printf("%d", n); f(n - 2); } }, what does the call f(7) print?
सही उत्तर: क) 7531
It prints n and recurses with n - 2: 7, 5, 3, 1; at -1 the recursion stops.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int add(int a, int b) { return a + b; } and int mul(int a, int b) { return a * b; }, what is printed by: int (*op[])(int, int) = {add, mul}; printf("%d", op[1](3, op[0](1, 2))); ?
सही उत्तर: घ) 9
op[0](1, 2) = add(1, 2) = 3, then op[1](3, 3) = mul(3, 3) = 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "Pokhara", *p = s; while (*p) p++; printf("%d", (int)(p - s)); ?
सही उत्तर: ग) 7
p stops at the terminating '\0'; the distance from the start is the string length, 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char *names[] = {"Ram", "Sita", "Hari"}; printf("%s", *(names + 1) + 2); ?
सही उत्तर: ख) ta
*(names + 1) is "Sita"; adding 2 skips two characters, leaving "ta".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a = 10, b = 4; printf("%d", a & b ? a | b : a ^ b); ?
सही उत्तर: क) 14
10 & 4 = 1010 & 0100 = 0 (false), so a ^ b = 1010 ^ 0100 = 1110 = 14 is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i = 0; loop: i++; if (i < 5) goto loop; printf("%d", i); ?
सही उत्तर: घ) 5
The goto repeats the increment until i < 5 becomes false, that is, when i = 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
With #define ABS(x) x < 0 ? -x : x in C, what is printed by printf("%d", ABS(2 - 5)); ?
सही उत्तर: ग) -7
The macro expands to 2 - 5 < 0 ? -2 - 5 : 2 - 5; the condition is true, so -2 - 5 = -7. Missing parentheses cause the error.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int f(int n) { static int s = 0; s += n; if (n > 0) f(n - 1); return s; }, what does f(4) return when called once?
सही उत्तर: ख) 10
The single static s accumulates 4 + 3 + 2 + 1 + 0 = 10 across all recursive calls, and the outer call returns it.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char *p = "Kathmandu"; int n = 0; while (*p) { if (strchr("aeiou", *p)) n++; p++; } printf("%d", n); ?
सही उत्तर: क) 3
strchr finds each lower-case vowel; Kathmandu contains a, a and u, so n = 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[10] = "ab"; strncat(s, "cdef", 2); printf("%s", s); ?
सही उत्तर: घ) abcd
strncat appends at most 2 characters of "cdef" ("cd") and a terminating '\0', giving "abcd".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।