Please input a number x, if the number is even, then shows that \" The number x
ID: 3632796 • Letter: P
Question
Please input a number x, if the number is even, then shows that " The number x is even number“; if the number is odd, then shows " The number x is odd numberIf you input a number it is not integer, and please shows "Please input the right format: (It must be a integer type)" Hint: Use "try" and "catch"
If you input "1000", and then stop this program (Hint: Use “ while”)
--------------------------------------------------------------
Output:
Please input a number:(Stop this programming if you input 1000)
5
The number 5 is odd number
Please input a number:(Stop this programming if you input 1000)
6
The number 6 is even number
Please input a number:(Stop this programming if you input 1000)
5.5
Please input the right format: (It must be a integer type)
Please input a number:(Stop this program if you input 1000)
1000
I won't forget to rate LifeSaver for best answer! Thanks!