प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C, what is the value of the integer expression 7 / 2 * 2?
सही उत्तर: घ) 6
/ and * have equal precedence and associate left to right: 7 / 2 = 3 (integer division), then 3 * 2 = 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the assignment operator = associates from:
सही उत्तर: क) right to left, so a = b = c = 5 assigns 5 to c first
Assignment is right-associative, so a = b = c = 5 is evaluated as a = (b = (c = 5)).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
For an integer n in C, the expression (n & 1) is non-zero exactly when n is:
सही उत्तर: घ) odd
The lowest bit of an integer is 1 for odd numbers, so n & 1 is 1 for odd n and 0 for even n.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Evaluate 12 & (12 - 1) in C, where & is the bitwise AND operator.
सही उत्तर: ख) 8
12 is 1100 and 11 is 1011; their bitwise AND is 1000 = 8. In general x & (x - 1) clears the lowest set bit.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which keyword was added in the C99 standard as the built-in Boolean data type?
सही उत्तर: घ) _Bool
C99 added the keyword _Bool; the header <stdbool.h> defines bool, true and false as convenient macros.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a C string, the escape sequence '\a' represents:
सही उत्तर: क) an alert (bell) character
'\a' is the alert character, which normally produces a beep; '\b' is backspace and '\r' carriage return.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Using the format "%05d", how does printf display the integer 42?
सही उत्तर: ग) 00042
The 0 flag with width 5 pads the number on the left with zeros instead of spaces.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
With the format string "%-5d|", which output does printf produce for the value 42?
सही उत्तर: क) 42 followed by three spaces and |
Width 5 with the '-' flag left-justifies the number, so 42 is printed and padded with three spaces on the right before the |.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which printf() conversion specifier prints a double in scientific (exponential) notation, such as 1.500000e+02?
सही उत्तर: घ) %e
%e prints a floating value as d.dddddde+xx, while %f prints fixed-point notation.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which printf() conversion specifier is used to print the value of a pointer (an address)?
सही उत्तर: ख) %p
%p prints a void pointer in an implementation-defined format, usually hexadecimal.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।