कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C code: char s[] = "C programming"; int i, w = 1; for (i = 0; s[i]; i++) if (s[i] == ' ') w++; printf("%d", w); ?
सही उत्तर: ग) 2
There is one space, so w goes from 1 to 2: the program counts the words.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a[] = {2, 7, 1, 8, 2}, i, m = 0; for (i = 1; i < 5; i++) if (a[i] > a[m]) m = i; printf("%d", m); ?
सही उत्तर: ख) 3
m holds the index of the largest element; the maximum 8 is at index 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int x = 1, y = 1; x += y += 2; printf("%d %d", x, y); ?
सही उत्तर: क) 4 3
Compound assignment is right-associative: y += 2 makes y = 3, then x += 3 makes x = 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "abcdef"; printf("%s", s + strlen(s) / 2); ?
सही उत्तर: घ) def
strlen(s) / 2 = 3, so printing starts at s[3], giving "def".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, j; for (i = 1; i <= 3; i++) { for (j = 3; j >= i; j--) printf("*"); printf("\n"); } What is printed on the second line?
सही उत्तर: ग) **
The inner loop runs 3 - i + 1 times: 3 stars, then 2, then 1, so line 2 is **.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
For positive integers a and b, the C expression (a + b - 1) / b computes:
सही उत्तर: ख) a / b rounded up (the ceiling)
Adding b - 1 before integer division rounds the quotient up; e.g. (7 + 2 - 1) / 2 = 4 = ceiling of 3.5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int m[2][3] = {{1, 2, 3}, {4, 5, 6}}; printf("%d", m[1][0] + *(m[0] + 2)); ?
सही उत्तर: क) 7
m[1][0] = 4 and *(m[0] + 2) = m[0][2] = 3, so the sum is 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i = 0, a[3]; for (; i < 3; i++) a[i] = i * i; printf("%d", a[a[2] - 3]); ?
सही उत्तर: घ) 1
a = {0, 1, 4}; a[2] - 3 = 1, and a[1] = 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given void r(const char *s) { if (*s) { r(s + 1); putchar(*s); } }, what does r("abc") print?
सही उत्तर: ग) cba
Each character is printed after the recursive call returns, so the string comes out reversed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int fun(int n) { if (n < 3) return n; return fun(n - 1) + fun(n - 3); }, what does fun(6) return?
सही उत्तर: ख) 7
fun(0..2) = 0, 1, 2; fun(3) = 2 + 0 = 2, fun(4) = 2 + 1 = 3, fun(5) = 3 + 2 = 5, fun(6) = 5 + 2 = 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।