कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C code: struct pt { int x, y; } a[3] = {{1, 2}, {3, 4}, {5, 6}}; struct pt *p = a; p++; printf("%d", p->x + (p + 1)->y); ?
सही उत्तर: ग) 9
After p++, p points to a[1], so p->x = 3, and (p + 1)->y is a[2].y = 6; 3 + 6 = 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, count = 0; for (i = 0; i < 20; i++) if (i % 3 == 0 || i % 5 == 0) count++; printf("%d", count); ?
सही उत्तर: ख) 9
Multiples of 3 below 20: 7 (including 0); multiples of 5: 4 (including 0); 0 and 15 are counted in both, so 7 + 4 - 2 = 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, j; for (i = 0, j = 5; i < j; i += 2, j--); printf("%d %d", i, j); ?
सही उत्तर: क) 4 3
(i, j) goes (0,5), (2,4), (4,3); now 4 < 3 is false, so 4 3 is printed. Note the empty loop body.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, j, c = 0; for (i = 1; i <= 4; i++) for (j = i; j <= 4; j++) c += j; printf("%d", c); ?
सही उत्तर: घ) 30
Sums are 1+2+3+4 = 10, 2+3+4 = 9, 3+4 = 7 and 4, giving 10 + 9 + 7 + 4 = 30.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i = 10; do printf("%d ", i); while (--i > 7); ?
सही उत्तर: ग) 10 9 8
10 is printed first; --i gives 9 (>7) and 8 (>7), both printed; then 7 > 7 is false.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "Nepal"; printf("%d", (int)(sizeof(s) - strlen(s))); ?
सही उत्तर: ख) 1
sizeof(s) is 6 (it includes the terminating '\0') while strlen(s) is 5, so the difference is 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int m[2][2] = {{1, 2}, {3, 4}}; printf("%d", m[0][1] * m[1][0] - m[0][0] * m[1][1]); ?
सही उत्तर: क) 2
m[0][1] * m[1][0] = 2 x 3 = 6 and m[0][0] * m[1][1] = 1 x 4 = 4; 6 - 4 = 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A C function rev(int *a, int n) swaps a[i] with a[n-1-i] for i = 0 to n/2 - 1. After int a[] = {1, 2, 3, 4, 5}; rev(a, 5); what is a[1]?
सही उत्तर: घ) 4
The function reverses the array to {5, 4, 3, 2, 1}, so a[1] = 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int f(int n) { return n > 100 ? n - 10 : f(f(n + 11)); } (McCarthy's 91 function), what does f(50) return?
सही उत्तर: ग) 91
For every n <= 100 this function returns 91; the nested calls climb above 100 and settle at 91.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given int f(int n) { return n <= 1 ? 1 : n * f(n - 1); }, what is printed by printf("%d", f(5) / f(3)); ?
सही उत्तर: ख) 20
f computes the factorial: 5! / 3! = 120 / 6 = 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।