प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by the C code: char s[] = "Lumbini"; printf("%c", *s + 1); ?
सही उत्तर: ग) M
*s is 'L'; adding 1 gives the next character code, 'M' (the * binds before +).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, s = 0; for (i = 5; i >= 1; i--) s = s * 10 + i; printf("%d", s); ?
सही उत्तर: ख) 54321
Each step appends the digit i: 5, 54, 543, 5432, 54321.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int x = 7; x %= 4; x <<= 2; printf("%d", x); ?
सही उत्तर: क) 12
7 % 4 = 3, and 3 << 2 = 3 x 4 = 12.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Pseudocode: X = 1; repeat X = X * 3 until X > 100; print X. What is printed?
सही उत्तर: क) 243
X becomes 3, 9, 27, 81 and then 243; 243 is the first value greater than 100, so the loop stops.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the binary representation of the decimal number 45?
सही उत्तर: घ) 101101
45 = 32 + 8 + 4 + 1, so the bits for 32, 8, 4 and 1 are set: 101101.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the 8-bit two's complement representation of -5?
सही उत्तर: ग) 11111011
5 is 00000101; inverting the bits gives 11111010, and adding 1 gives 11111011.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the result of rotating the array [1, 2, 3, 4, 5] to the left by 2 positions?
सही उत्तर: ख) [3, 4, 5, 1, 2]
A left rotation by 2 moves the first two elements (1, 2) to the end: [3, 4, 5, 1, 2].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Checking whether a singly linked list contains a cycle, by moving one pointer one step and another pointer two steps at a time, is known as:
सही उत्तर: क) Floyd's cycle-finding (tortoise and hare) algorithm
In Floyd's algorithm the fast and slow pointers meet if and only if the list has a cycle.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
With the root at level 0, what is the maximum number of nodes at level 5 of a binary tree?
सही उत्तर: घ) 32
Each level can hold at most twice as many nodes as the previous one, so level L holds at most 2^L nodes: 2^5 = 32.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The average-case time complexity of quicksort on n elements is:
सही उत्तर: ग) O(n log n)
On average the partitions are reasonably balanced, giving about log n levels of O(n) work each.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।