Question: What will be the output of the algorithm given below? Algorithm 1 . Start 2 . Initialize a , b = 5 c = 2

What will be the output of the algorithm given below?
Algorithm
1. Start
2. Initialize a, b =5 c =2,i,j
3. Compute a = b +c
4. Compute b = a % c
5. Set i =1
6. Repeat step 7 until i <3 step by 1
7. Print i
End loop
8. Check if a + b > i then
9. Set j =1
10. Repeat step 11 until j <2 step by 1
11. Print j + i
End for
End if
12. Check if a % c <= j
13. Print "Nice"
14. Else print "Morning"
Else if
15. Stop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!