कम्प्युटर / सूचना प्रविधि कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक – प्राविधिक पत्र
कम्प्युटर / सूचना प्रविधि – कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक
Computer Operator & Assistant · Computer & IT Posts
२,५७७ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्राविधिक पत्र: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ५ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What does the following C code print? int a = 4, b = 9, c = 6; int m = a > b ? (a > c ? a : c) : (b > c ? b : c); printf("%d", m);
सही उत्तर: क) 9
a > b is false, so (b > c ? b : c) is evaluated, giving 9, the largest of the three.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On a typical system, what does the following C code print? printf("%d", sizeof(int) > -1);
सही उत्तर: घ) 0
sizeof yields an unsigned size_t, so -1 is converted to a huge unsigned value and 4 > that value is false (0).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? char *s = "banana"; printf("%d", (int)(strrchr(s, 'n') - s));
सही उत्तर: ख) 4
strrchr() returns a pointer to the last 'n', which is at index 4 of "banana".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? int i = 3; while (i < 50) i <<= 1; printf("%d", i);
सही उत्तर: ग) 96
i doubles each time: 3, 6, 12, 24, 48, 96; the loop stops when i = 96 (not less than 50).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following C code print? printf("%d", 10 >> 1 << 2);
सही उत्तर: क) 20
Shifts are left-associative: 10 >> 1 = 5, then 5 << 2 = 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The recurrence T(n) = 2T(n - 1) + 1, with T(1) = 1, which describes the Tower of Hanoi, has the solution:
सही उत्तर: घ) O(2^n)
Unrolling gives T(n) = 2^n - 1, which grows exponentially, O(2^n).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the time complexity of: for (i = 0; i < n; i++) for (j = 0; j < 100; j++) count++; ?
सही उत्तर: क) O(n)
The inner loop always runs a constant 100 times, so the total work is 100n, which is O(n).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In an array-based circular queue of size 8, front is the index of the first element and rear is the index where the next element will be inserted. If front = 6 and rear = 2, how many elements are in the queue?
सही उत्तर: ग) 4
The occupied slots are 6, 7, 0 and 1, which is (rear - front + n) % n = (2 - 6 + 8) % 8 = 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Keys 23, 43, 13 and 27 are inserted in that order into a hash table of size 10 using h(k) = k mod 10 with linear probing. At which index is 13 stored?
सही उत्तर: क) 5
23 goes to index 3; 43 collides and goes to 4; 13 collides at 3 and 4 and is placed at 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The keys 7, 3, 5 and 1 are inserted one by one into an empty min-heap stored in an array. What is the array after the last insertion?
सही उत्तर: घ) [1, 3, 5, 7]
After 7, 3, 5 the heap is [3, 7, 5]; 1 is added at index 3, swaps with its parent 7 and then with the root 3, giving [1, 3, 5, 7].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।