प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Which C function writes formatted output to a file?
सही उत्तर: क) fprintf()
fprintf(fp, format, ...) works like printf() but writes to the file stream fp.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In most C implementations, the end-of-file marker EOF returned by functions such as getc() has the value:
सही उत्तर: क) -1
EOF is a negative int constant defined in stdio.h, almost always -1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Opening an existing file with fopen() in "w" mode:
सही उत्तर: ग) erases (truncates) its existing contents
w mode truncates an existing file to zero length, or creates a new one.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which fopen() mode opens a text file for writing at the end of its existing contents?
सही उत्तर: घ) a
Mode a (append) writes at the end of the file, creating it if it does not exist.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the elements of a two-dimensional array are stored in memory in:
सही उत्तर: क) row-major order
C stores a 2-D array row by row: all of row 0, then row 1, and so on.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, if sizeof(int) is 4, how many bytes does the array int a[3][4]; occupy?
सही उत्तर: ग) 48
The array has 3 x 4 = 12 elements, each 4 bytes, so 12 x 4 = 48 bytes.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is printed by: int x = 10; int *p = &x; *p = 20; printf("%d", x);
सही उत्तर: ग) 20
*p refers to x itself, so assigning 20 through the pointer changes x to 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which is the correct meaning of the C declaration int (*p)[5]; ?
सही उत्तर: घ) a pointer to an array of 5 ints
The parentheses make p a pointer first; what it points to is an array of 5 ints.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the declaration int *p[5]; declares p as:
सही उत्तर: ख) an array of 5 pointers to int
[] binds tighter than *, so p is an array of 5 elements, each of type int *.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Repeatedly allocating dynamic memory and never freeing it when it is no longer needed causes a:
सही उत्तर: ख) memory leak
Unreleased heap memory becomes unusable for the rest of the program's life, which is a memory leak.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।