कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Trace this C fragment and give its output: int i, s; for (i = 0, s = 0; i < 4; i++, s += i); printf("%d", s);
सही उत्तर: घ) 10
The loop body is empty; after each increment of i, s += i adds 1, 2, 3 and 4, giving 10.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: char s[] = "a1b2c3"; int i, c = 0; for (i = 0; s[i]; i++) if (isdigit(s[i])) c++; printf("%d", c);
सही उत्तर: ग) 3
isdigit() is true only for '1', '2' and '3', so the count is 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: const char *days[] = {"Sun", "Mon", "Tue"}; printf("%c", days[1][2]);
सही उत्तर: ख) n
days[1] is "Mon", and index 2 of "Mon" is the character 'n'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int x = 10; int *p = &x; int **pp = &p; printf("%d", **pp + *p);
सही उत्तर: क) 20
Both **pp and *p refer to x, which is 10, so the sum is 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int n = 153, t = n, s = 0; while (t) { int r = t % 10; s += r * r * r; t /= 10; } printf("%d", s == n);
सही उत्तर: क) 1
1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153, so s == n is true and 1 is printed (153 is an Armstrong number).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int n = 40500, d = 0; do { d++; n /= 10; } while (n); printf("%d", d);
सही उत्तर: घ) 5
Each pass removes one digit; 40500 has 5 digits, so the loop runs 5 times and d is 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int n, d, c = 0; for (n = 2; n <= 20; n++) { for (d = 2; d * d <= n; d++) if (n % d == 0) break; if (d * d > n) c++; } printf("%d", c);
सही उत्तर: ग) 8
The code counts primes from 2 to 20 (2, 3, 5, 7, 11, 13, 17, 19), so it prints 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int a = 4, b = 6, l = a; while (l % b) l += a; printf("%d", l);
सही उत्तर: ख) 12
l takes multiples of 4 (4, 8, 12) until one is divisible by 6; 12 is the LCM of 4 and 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int i, x = 0; for (i = 1; i <= 5; i++) x = x * 2 + 1; printf("%d", x);
सही उत्तर: क) 31
x becomes 1, 3, 7, 15 and 31 in the five iterations (each time 2^i - 1).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int a[3] = {10, 20, 30}; int *p = &a[2]; printf("%d", *(p - 1) + p[-2]);
सही उत्तर: घ) 30
p points to a[2]; *(p - 1) is a[1] = 20 and p[-2] is a[0] = 10, so the sum is 30.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।