प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Which relationship between the sizes of C integer types is guaranteed by the C standard?
सही उत्तर: ग) sizeof(short) <= sizeof(int) <= sizeof(long)
The standard fixes only minimum ranges and this ordering; actual sizes vary between platforms.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On most modern systems, sizeof(double) in C is:
सही उत्तर: ख) 8 bytes
double is normally an IEEE 754 64-bit (8-byte) floating-point type.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, if an arithmetic operation on signed int values produces a result too large to represent, the behaviour is:
सही उत्तर: ग) undefined
Signed integer overflow is undefined behaviour in C, unlike unsigned arithmetic, which is defined to wrap modulo 2^n.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In nested if statements in C, an else clause is associated with:
सही उत्तर: ख) the nearest preceding if that does not already have an else
This rule resolves the 'dangling else' ambiguity; braces can be used to pair an else with a different if.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The C do-while loop is written as do { ... } while (condition) and must end with:
सही उत्तर: ख) a semicolon after the closing parenthesis
Unlike the while loop, the do-while statement is terminated by a semicolon after while (condition).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which statement about the default label in a C switch statement is correct?
सही उत्तर: ग) It is optional and may be placed anywhere among the case labels
default is optional, may appear in any position, and is taken only when no case value matches.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by: int x = 3; switch (x) { default: printf("D"); case 1: printf("A"); break; case 2: printf("B"); } ?
सही उत्तर: घ) DA
No case matches 3, so control jumps to default and prints D; with no break it falls through to case 1, prints A, then breaks.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by: int i = 5; while (i > 0) i -= 2; printf("%d", i); ?
सही उत्तर: घ) -1
i goes 5, 3, 1, -1; the loop stops when i becomes -1, which is then printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many times does the body of the C loop for (i = 1; i < 20; i = i * 3) execute?
सही उत्तर: ग) 3
i takes the values 1, 3 and 9; the next value 27 fails the test i < 20, so the body runs 3 times.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Following C operator precedence rules, 5 + 3 % 2 * 4 evaluates to:
सही उत्तर: ख) 9
% and * are evaluated before +, left to right: 3 % 2 = 1, 1 * 4 = 4, and 5 + 4 = 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।