प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In C, the statement j = i++ + ++i; (which modifies i twice without an intervening sequence point) has:
सही उत्तर: ख) Undefined behaviour
Modifying the same scalar object twice without sequencing is undefined behaviour in C, so different compilers may give different results.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many times does the body of the C loop for (i = 0, j = 10; i < j; i++, j--) execute?
सही उत्तर: ग) 5
The pairs (i, j) are (0,10), (1,9), (2,8), (3,7), (4,6); at (5,5) the condition i < j fails, so the body runs 5 times.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, what is the value of y after: int x = 5; int y = x > 3 ? (x < 4 ? 1 : 2) : 3; ?
सही उत्तर: क) 2
x > 3 is true, so the inner conditional is evaluated; x < 4 is false, so y = 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Re-running previously passed tests after a program is modified, to make sure the change has not broken existing features, is called:
सही उत्तर: ग) regression testing
Regression testing checks that new changes have not reintroduced faults into previously working code.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Which language is a well-known example of the logic programming paradigm?
सही उत्तर: ग) Prolog
Prolog programs are written as facts and rules, and answers are found by logical inference.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The first phase of a compiler, which reads source characters and groups them into tokens, is:
सही उत्तर: ग) lexical analysis
The lexical analyser (scanner) produces tokens such as keywords, identifiers and operators for the parser.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The undecidability of the halting problem, proved by Alan Turing, means that:
सही उत्तर: घ) no general algorithm can decide, for every program and input, whether the program will halt
Turing showed that a universal halting-decider cannot exist, giving a fundamental limit of computation.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
How many comparisons does selection sort make to sort an array of 5 elements?
सही उत्तर: घ) 10
Selection sort always makes n(n - 1)/2 comparisons: 5 x 4 / 2 = 10.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The recurrence T(n) = T(n - 1) + n, with T(1) = 1, has the solution:
सही उत्तर: ग) O(n^2)
Expanding gives n + (n - 1) + ... + 1 = n(n + 1)/2, which is O(n^2).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The recurrence T(n) = T(n/2) + c, as in binary search, has the solution:
सही उत्तर: ग) O(log n)
The problem size halves each step with constant work, giving about log2 n steps.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।