Westonci.ca is the ultimate Q&A platform, offering detailed and reliable answers from a knowledgeable community. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

write a program to enter any two numbers and find out whether it is even or odd using select case statement.


Sagot :

Answer:

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.

However, if the test expression evaluates to 0 (false), the number is odd.

Hope this helps u! :)