Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.1k views
in Computer by (69.8k points)

A program has been compiled and linked successfully. When you run this program you face one or more of the following situations 

(i) Program executed, but no output 

(ii) It produces incorrect answers 

(iii) It does not stop running. What are the possible causes in each case and what steps would you take to correct them? 

1 Answer

+1 vote
by (69.2k points)
selected by
 
Best answer

A program has been compiled and linked successfully. 

(i) Program executed, but no output: this usually happens due to run time errors in the program like referencing an out-of-range array element or mismatch of data types. 

(ii) It produces incorrect answers: Then there may be logical errors in the program like failure to consider a particular condition or incorrect translation of the algorithm into the program or incorrect order of evaluation of statements etc.

(iii) It does not stop running: This happens when we make use of correct syntax statement but incorrect logic like if(code=1) count++;

Instead of using comparison operator we are using assignment which is syntactically correct so count++ is always executed resulting in infinite loop. Similar mistakes may occur in other control statements, such as for and while loop that causes infinite loops and does not stop running. 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...