कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Trace this C fragment and give its output: printf("%d", strncmp("Nepal", "Nepali", 5));
सही उत्तर: ग) 0
strncmp compares only the first 5 characters, and 'Nepal' matches the first 5 characters of 'Nepali', so it returns 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int n = 1; switch (n) { case 1: n += 2; case 2: n *= 3; break; case 3: n = 0; } printf("%d", n);
सही उत्तर: ख) 9
Case 1 makes n = 3; with no break, control falls through to case 2, which makes n = 9, and then break exits the switch.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: printf("%5s|", "ab");
सही उत्तर: क) three spaces, then ab|
%5s prints the string right-justified in a field 5 characters wide, so 'ab' is preceded by three spaces.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: printf("%o", 8);
सही उत्तर: घ) 10
%o prints the value in octal, and decimal 8 is 10 in octal (1 x 8 + 0).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int x = 1; x = x << 4 | x; printf("%d", x);
सही उत्तर: ग) 17
<< has higher precedence than |, so the expression is (1 << 4) | 1 = 16 | 1 = 17.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int x = 5; int y = x << 2 >> 1; printf("%d", y);
सही उत्तर: ख) 10
Shift operators group left to right: 5 << 2 = 20, then 20 >> 1 = 10.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: char s[] = "level"; int i, n = strlen(s), ok = 1; for (i = 0; i < n / 2; i++) if (s[i] != s[n - 1 - i]) ok = 0; printf("%s", ok ? "yes" : "no");
सही उत्तर: क) yes
The code compares characters from both ends; 'level' reads the same backwards (a palindrome), so ok stays 1 and 'yes' is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int a[5] = {0}; a[2] = 7; a[4] = 1; int i, s = 0; for (i = 0; i < 5; i++) s += a[i] * i; printf("%d", s);
सही उत्तर: घ) 18
All other elements are 0, so s = 7 * 2 + 1 * 4 = 18.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int s = 0, i; for (i = 10; i > 0; i -= 3) s += i; printf("%d", s);
सही उत्तर: ग) 22
i takes the values 10, 7, 4 and 1, and their sum is 22.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Trace this C fragment and give its output: int i = 0; while (i < 5) { i++; if (i == 3) continue; printf("%d", i); }
सही उत्तर: ख) 1245
i is incremented before printing, so 1 to 5 are considered; continue skips printing when i is 3, giving 1245.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।