Step-by-Step Explanation of an Algorithm to Print Numbers from 1 to 5
Algorithm: Start Initialize a variable num with the value 1. Repeat the following steps until num is greater than 5: Print the value of num. Increment num by 1. End Example in Pseudocode: BEGIN num ← 1 WHILE num ≤ 5 DO PRINT num num ← num + 1 END WHILE END The algorithm to […]
Step-by-Step Explanation of an Algorithm to Print Numbers from 1 to 5 Read More »