
Edward F. answered 12/29/22
Always Happy to Help
This task can be achieved by iteration, updating the maximum, and printing out the maximum after each iteration.
Nagendra C.
asked 12/26/22Maximum You are given N number of inputs. Print the maximum of them after each input.
Explanation In the example, you are given 6 inputs 1, 0, 3, 2, 9, 8
1 is maximum in the input 1.
1 is maximum in the input 1, 0.
3 is maximum in the input 1, 0, 3.
3 is maximum in the input 1, 0, 3, 2.
9 is maximum in the input 1, 0, 3, 2, 9.
9 is maximum in the input 1, 0, 3, 2, 9,
so,the output should be
1
3
3
9
9
Edward F. answered 12/29/22
Always Happy to Help
This task can be achieved by iteration, updating the maximum, and printing out the maximum after each iteration.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.