Page 1 of 1

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
by answerhappygod
Q2 The Following Algorithm Prints The First N Odd Numbers Starting From 1 5 Marks 1 Identify The Problem S With Th 1
Q2 The Following Algorithm Prints The First N Odd Numbers Starting From 1 5 Marks 1 Identify The Problem S With Th 1 (55.86 KiB) Viewed 39 times
please explain this
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.