कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C, given void p(int n) { if (n) { printf("%d", n); p(n - 1); printf("%d", n); } } what does the call p(3) print?
सही उत्तर: ग) 321123
Each call prints n before recursing and again after returning, so the output is 3 2 1 on the way down and 1 2 3 on the way back up.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a[] = {3, 1, 4, 1, 5, 9}; printf("%d", (int)(sizeof(a) / sizeof(a[0]))); ?
सही उत्तर: ग) 6
sizeof(a) is the size of the whole array and sizeof(a[0]) the size of one element, so their ratio is the number of elements, 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On an ASCII system, what does the C statement printf("%d", 'A' < 'a'); print?
सही उत्तर: ख) 1
'A' has code 65 and 'a' has code 97, so the comparison is true and a relational expression yields 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Evaluate the C expression 6 & ~2 (bitwise AND with a bitwise NOT).
सही उत्तर: घ) 4
~2 clears only bit 1; 6 is binary 110, and clearing bit 1 gives 100, which is 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a = 5; int b = a << 1 | 1; printf("%d", b); ?
सही उत्तर: ग) 11
<< has higher precedence than |: 5 << 1 = 10 (binary 1010), and 10 | 1 = 11 (binary 1011).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "programming"; int i, c = 0; for (i = 0; s[i]; i++) if (s[i] == 'm') c++; printf("%d", c); ?
सही उत्तर: ख) 2
The loop stops at the terminating '\0'; the letter 'm' occurs twice in "programming".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many times is n++ executed by: for (i = 0; i < 5; i++) for (j = i; j < 5; j++) n++; ?
सही उत्तर: ख) 15
The inner loop runs 5, 4, 3, 2 and 1 times for i = 0 to 4, giving 5 + 4 + 3 + 2 + 1 = 15.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, s = 0; for (i = 1; i <= 20; i += 4) s += i; printf("%d", s); ?
सही उत्तर: घ) 45
i takes the values 1, 5, 9, 13 and 17 (21 fails the test), and 1 + 5 + 9 + 13 + 17 = 45.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int a = 7, b = 3; printf("%d", a % b * b + a / b); ?
सही उत्तर: घ) 5
% and * have equal precedence and associate left to right: (7 % 3) * 3 = 3, and 7 / 3 = 2 (integer division), so 3 + 2 = 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which sorting algorithm repeatedly picks the next element and inserts it into its correct place among the already sorted elements to its left?
सही उत्तर: ख) Insertion sort
Insertion sort grows a sorted prefix by inserting one new element at a time into its correct position.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।