Odds and Evens Applications

前端 未结 1 531
渐次进展
渐次进展 2021-01-29 12:21

I am generating 25 random integers between 0 and 99. However I have to display all the evens on one line and all the odds on the next line. How can I do it?

pub         


        
相关标签:
1条回答
  • 2021-01-29 13:14

    Use two loops. In both iterate over all numbers but in first test if number is even, if so print it, in second check if number is odd, if so print it.

    0 讨论(0)
提交回复
热议问题