Nepal Police2082 BSQuestion 6 of 8
What is an algorithm? Write an algorithm to find the largest of three numbers.
5 marks
Question source
- Exam year
- 2082 BS / 2025 AD
- Level
- Level 5
- Paper
- Technical – Subjective
- Section
- Section A: Short Answer Questions (6 × 5 = 30 marks)
Model answer
Algorithm is a step-by-step, finite set of well-defined instructions for solving a specific problem or performing a specific task.
Algorithm to find the largest of three numbers (A, B, C):
- START
- Read three numbers A, B, C
- IF A > B AND A > C THEN
- Print "A is the largest"
- ELSE IF B > A AND B > C THEN
- Print "B is the largest"
- ELSE
- Print "C is the largest"
- STOP