Question: language c++ Exercise 3 Define a character constant variable named compass and give it a value (e.g., 'S'). Use a switch statement that will print
language c++ Exercise 3 Define a character constant variable named compass and give it a value (e.g., 'S'). Use a switch statement that will print North, South, East, West, for the respective N, S, E, W, cases. If the value of the compass is not any of the N, S, E, W, print Invalid. Write a second version of the program using the if...else-if...else statement instead of a switch
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
