प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
The Liskov Substitution Principle of object-oriented design states that:
सही उत्तर: क) objects of a subclass should be usable wherever objects of its superclass are expected without breaking the program
A derived class must honour the behaviour promised by its base class so that it can substitute for it safely.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A Department object holds references to Professor objects, but the professors can exist even if the department is closed. This relationship is called:
सही उत्तर: ख) aggregation
Aggregation is a weak has-a relationship in which the part can exist independently of the whole; in composition the part's life depends on the whole.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In object-oriented programming, objects interact with one another mainly by:
सही उत्तर: ख) sending messages, that is, calling each other's methods
Message passing means one object requests a service from another by invoking one of its methods.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Placing a block of C code between #if 0 and #endif:
सही उत्तर: घ) excludes that code from compilation
Since the condition 0 is false, the preprocessor removes the enclosed code, which is a common way to disable code temporarily.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a C macro definition, the single # operator placed before a parameter (as in #define STR(x) #x):
सही उत्तर: ग) converts the argument into a string literal
The # (stringizing) operator turns the macro argument into a quoted string, so STR(abc) becomes "abc".
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the preprocessor directive #undef is used to:
सही उत्तर: क) remove a previously defined macro
#undef NAME cancels an earlier #define of NAME so it can be redefined or left undefined.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which C standard library function deletes a file by name?
सही उत्तर: क) remove()
remove(filename), declared in <stdio.h>, deletes the named file and returns 0 on success.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The fopen() mode "rb" opens a file for:
सही उत्तर: ख) reading in binary mode
"r" means read and the b means binary, so no newline translation is done on systems that distinguish text and binary.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In a C program, which standard stream is intended for error and diagnostic messages?
सही उत्तर: घ) stderr
C opens stdin, stdout and stderr automatically; stderr is used for error messages and is normally unbuffered.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which pair of C functions is normally used to read and write blocks of binary data, such as whole structures, to a file?
सही उत्तर: क) fread() and fwrite()
fread and fwrite copy a given number of items of a given size directly between memory and the file.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।