प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Given the macro #define SQ(x) x*x in C, what is the value of SQ(2+3)?
सही उत्तर: ख) 11
Macro expansion is textual: SQ(2+3) becomes 2+3*2+3 = 2 + 6 + 3 = 11.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which preprocessor directive is used in C to define a macro or symbolic constant?
सही उत्तर: क) #define
#define NAME value creates a macro that the preprocessor substitutes before compilation.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, given char s[] = "Nepal"; what is the value of sizeof(s)?
सही उत्तर: ग) 6
The array holds 5 characters plus the terminating null character, so its size is 6 bytes.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C library function appends one string to the end of another?
सही उत्तर: क) strcat()
strcat(dest, src) concatenates src onto the end of dest.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by: printf("%d", strcmp("abc", "abc"));
सही उत्तर: घ) 0
strcmp() returns 0 when the two strings are identical.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, an automatic local variable that is declared but not initialised contains:
सही उत्तर: ग) an indeterminate (garbage) value
Automatic variables are not initialised by default, so their value is whatever was left in that memory.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C storage-class keyword declares a variable that is defined in another source file?
सही उत्तर: ग) extern
extern declares a variable without defining it, telling the compiler it is defined elsewhere.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, a static int variable that is not explicitly initialised starts with the value:
सही उत्तर: ख) 0
Variables with static storage duration are automatically initialised to zero.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by: int x = 2; switch (x) { case 1: printf("A"); case 2: printf("B"); case 3: printf("C"); break; default: printf("D"); }
सही उत्तर: ग) BC
Execution starts at case 2, prints B, falls through to case 3 (no break) printing C, then break exits the switch.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C keyword transfers control unconditionally to a labelled statement within the same function?
सही उत्तर: घ) goto
goto label; jumps directly to the statement marked label: in the same function.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।