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
2.0k views
in Computer by (69.8k points)

What are the essential features of an algorithm? Write an algorithm to obtain H.C.F. of two given positive integers.

1 Answer

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

Essential features of an algorithm:  

1.Input: The algorithm should take zero or more input. 

2. Output: The algorithm should produce one or more outputs. 

3. Definiteness: Each and every step of algorithm should be defined unambiguously.

4. Effectiveness: A human should be able to calculate the values involved in the procedure of the algorithm using paper and pencil. 

5. Termination: An algorithm must terminate after a finite number of steps. Writing algorithms is an art so the language used to write algorithms should be simple and precise. Each and every step of the algorithm should be clear and unambiguous and should not convey more than one meaning to the programmer. A C language algorithm to obtain H.C.F. of two given positive integers is listed below: 

r=a%b; 

a=b; 

b=r;

printf("H.C.F. of %d and %d = %d",h,k,a); 

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

...