Q2. The following algorithm prints the first N odd numbers starting from 1. (5 marks) 1) Identify the problem(s) with th
Posted: Fri Jul 01, 2022 5:46 am
Q2. The following algorithm prints the first N odd numbers starting from 1. (5 marks) 1) Identify the problem(s) with the given algorithm? Input: number of odd numbers, N Problems Output: First N odd numbers starting from 1 Steps: 1. Set K-1 2. Print K 3. Increment K by 1 4. Go to step 2 5. Stop 2) Fix and rewrite the algorithm to behave according to the description above.