कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Assuming sizeof(int) is 4, what is printed by: int a[] = {10, 20, 30}; printf("%d", (int)((char *)(a + 2) - (char *)a)); ?
सही उत्तर: क) 8
a + 2 is two ints (8 bytes) beyond a; subtracting char pointers gives the difference in bytes, 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int k = 1; do { k *= 3; } while (k < 50); printf("%d", k); ?
सही उत्तर: ख) 81
k becomes 3, 9, 27 and 81; 81 is not less than 50, so the loop ends.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On a two's complement system, what is printed by the C code: int y = 12; printf("%d", y & -y); ?
सही उत्तर: ग) 4
y & -y keeps only the lowest set bit; 12 is binary 1100, whose lowest set bit is 100 = 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: char s[] = "abcd", t; int i, j; for (i = 0, j = 3; i < j; i++, j--) { t = s[i]; s[i] = s[j]; s[j] = t; } printf("%s", s); ?
सही उत्तर: क) dcba
The loop swaps characters from both ends towards the middle, reversing the string.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does printf("%#x", 255); print in C?
सही उत्तर: ग) 0xff
The # flag with %x adds the 0x prefix, and 255 in hexadecimal is ff.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, with #define MAX(a,b) ((a) > (b) ? (a) : (b)) and int i = 3, j = 2; what is printed by int m = MAX(i++, j); printf("%d %d", m, i); ?
सही उत्तर: क) 4 5
The macro expands to ((i++) > (j) ? (i++) : (j)); i++ is evaluated in the test (3 > 2, i becomes 4) and again in the chosen branch (m = 4, i becomes 5).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, given void f(int a[]) { a[0] = 99; } and int b[2] = {1, 2}; what does f(b); printf("%d", b[0]); print?
सही उत्तर: ख) 99
An array argument is passed as a pointer to its first element, so the function modifies the caller's array.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A C file has a global int x = 10; and void g(void) { x++; }. In main, int x = 1; g(); printf("%d", x); is executed. What is printed?
सही उत्तर: क) 1
g() increments the global x, but inside main the local x (value 1) hides the global one, so 1 is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by the C code: int i, count = 0; for (i = 1; i <= 10; i++) { if (i % 2) continue; if (i > 8) break; count += i; } printf("%d", count); ?
सही उत्तर: ग) 20
Odd i are skipped by continue; the even values 2, 4, 6 and 8 are added (20), and at i = 10 the loop breaks.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, printf("%.1f", 5 / 2 * 2.0); displays:
सही उत्तर: क) 4.0
5 / 2 is integer division giving 2; then 2 * 2.0 = 4.0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।