प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is printed by: int a[3] = {1, 2, 3}; printf("%d", a[1] + 2[a]); ?
सही उत्तर: क) 5
a[i] is defined as *(a + i), so 2[a] equals a[2] = 3; the sum is 2 + 3 = 5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
On Linux/Unix, the object file produced by compiling a C source file usually has the extension:
सही उत्तर: क) .o
gcc -c file.c produces file.o; on Windows the usual extension is .obj.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The correct order of steps in building an executable from a C source file is:
सही उत्तर: घ) preprocessing, compiling, assembling, linking
The preprocessor expands directives, the compiler produces assembly, the assembler makes object code and the linker builds the executable.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The predefined C macro __LINE__ expands to:
सही उत्तर: क) the current line number in the source file
__LINE__ gives the line number and __FILE__ gives the file name, useful in error messages.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a C macro definition, the ## operator is used for:
सही उत्तर: क) token pasting (joining two tokens into one)
For example, #define CAT(a,b) a##b makes CAT(x,1) become x1; the single # is the stringizing operator.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C function moves the file position indicator to a specified position in a file?
सही उत्तर: ख) fseek()
fseek(fp, offset, origin) sets the file position; ftell() reports it.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
If malloc() cannot allocate the requested block of memory, it returns:
सही उत्तर: ग) NULL
malloc returns a null pointer on failure, so the result should always be checked.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Inside a C structure, the member declaration unsigned int flag : 1; declares:
सही उत्तर: क) a bit field that occupies only 1 bit
The ': 1' gives the width of the bit field in bits.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Given union u { int i; double d; char c; }; with int = 4 bytes and double = 8 bytes, sizeof(union u) is:
सही उत्तर: ग) 8
All members of a union share the same memory, so its size is that of the largest member (the 8-byte double).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The C declaration int * const p = &x; means that:
सही उत्तर: क) p must always point to x, but the value of x can be changed through p
Here const applies to the pointer itself, so p cannot be reassigned, while *p = 5 is allowed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।