Question: Write a program segment for the following using (a) if statement and (b) switch ..case statement: If the value of the integer variable ME is
Write a program segment for the following using (a) if statement and (b) switch ..case statement:
If the value of the integer variable ME is less than 2 and greater than 0, assign the value of ME to integer variable YOU. If the value of ME is 5, multiply variables THEY and THEM and assign the results to variable YOU. If the value of ME is 2, increment YOU by 1. If the value of ME is 7, decrement YOU by 4. Any other value of ME would display the value of YOU.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
