MCQ Answer

Consider two algorithms A and B solving the same problem. Algorithm A always terminates but sometimes produces incorrect output, while algorithm B produces correct output but may not terminate for some inputs. Which statement is TRUE?

Consider two algorithms A and B solving the same problem. Algorithm A always terminates but sometimes produces incorrect output, while algorithm B produces correct output but may not terminate for some inputs. Which statement is TRUE?

Algorithm A हमेशा terminate होता है लेकिन कभी-कभी incorrect output देता है; Algorithm B हमेशा correct output देता है लेकिन कुछ inputs के लिए terminate नहीं हो सकता। कौन-सा statement TRUE है?
Topic : Algorithm and Flowcharts to solve problems

A. A is preferable because it terminates

B. B is preferable because correctness is fundamental

C. Both satisfy algorithm correctness

D. Both violate essential properties of algorithms




Correct Answer is :

D. Both violate essential properties of algorithms



Explanation
A valid algorithm should be both correct and finite. A lacks correctness; B lacks guaranteed termination.

सही algorithm में correctness और finiteness दोनों आवश्यक हैं। A correct नहीं है और B सभी inputs के लिए terminate नहीं होता।
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad