does the output need to be shown in the very end or while the input is taken… for example like i saw in the other questions the input was taken and displayed just after but the question had that
input:
1
2
8
42
88
output:
1
2
8
42
so i dont quite get how the output needs to be displayed
You can output whenever you want either in the end or in parallel with the input…Both will give right answers…The question says to display numbers in new line till the number 42 appears…i.e “Stop processing input after reading in the number 42”.
It would be easy and efficient to display as soon as they are entered because then you don’t have to store them in an array etc…and not loop again to display…