कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C code: int a[] = {4, 7, 1, 9, 2}, i, s = 0; for (i = 0; i < 5; i++) if (a[i] % 2) s += a[i]; printf("%d", s); ?
सही उत्तर: घ) 17
a[i] % 2 is non-zero for the odd values 7, 1 and 9, whose sum is 17.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int x = 10, y = 20; x = x + y; y = x - y; x = x - y; printf("%d %d", x, y); ?
सही उत्तर: घ) 20 10
x becomes 30, then y = 30 - 20 = 10, then x = 30 - 10 = 20, so the values are swapped without a temporary variable.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: double d = 7 / 2; printf("%.1f", d); ?
सही उत्तर: क) 3.0
7 / 2 is integer division giving 3 before the value is stored in d, so d is 3.0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i; long x = 1; for (i = 0; i < 10; i++) x *= 2; printf("%ld", x); ?
सही उत्तर: ख) 1024
Doubling 1 ten times gives 2 to the power 10, which is 1024.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i = 3; printf("%d", i ? i-- ? i : 7 : 9); ?
सही उत्तर: ग) 2
i is 3 (true), then i-- yields 3 (true) and sets i to 2; there is a sequence point after the condition, so the result is i = 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int k = 0; while (k++ < 3); printf("%d", k); ?
सही उत्तर: ग) 4
The semicolon makes the loop body empty; the test k++ < 3 is made with k = 0, 1, 2, 3, and the last (false) test still increments k to 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a[2][3] = {{1, 2, 3}, {4, 5, 6}}; printf("%d", *(*(a + 1) + 2)); ?
सही उत्तर: घ) 6
*(a + 1) is row a[1], and adding 2 then dereferencing gives a[1][2], which is 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int x = 5; { x = 6; int x = 7; } printf("%d", x); ?
सही उत्तर: क) 6
Inside the block, x = 6 changes the outer x before the inner x is declared; the inner x = 7 disappears at the end of the block.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, with #define DOUBLE(x) x + x, what is printed by printf("%d", 3 * DOUBLE(2)); ?
सही उत्तर: ख) 8
The macro expands textually to 3 * 2 + 2, and multiplication is done first, giving 8 (not 12).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: printf("%s", "Lok" "Sewa"); ?
सही उत्तर: ख) LokSewa
Adjacent string literals are joined by the compiler into one literal, "LokSewa", with no space added.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।