Computer Science, asked by thapasulaxana, 9 months ago

write algorithm for determining a number is "odd' or "even" supplied by user

Answers

Answered by Anonymous
2

Answer:

\huge\star{\underline{\mathtt{\red{A} \pink{N}\green{S}\blue{W}\purple{E} \orange{R}}}}\huge\star

In the program, the integer entered by the user is stored in the variable num . Then, whether num is perfectly divisible by 2 or not is checked using the modulus % operator. If the number is perfectly divisible by 2 , test expression number%2 == 0 evaluates to 1 (true). This means the number is even.

Similar questions