Question: Write a program that reads two integers and a character. If the input character is the letter y . your program swaps the two integers

Write a program that reads two integers and a character. If the input character is the letter y. your program swaps the two integers and then prints the result. Otherwise, your program displays the string "No swap!".a. Input and output samples:i. The input character is the letter y:a=2b=1il. The input character is not the letter y:12nNo swap!12y or 12n are input from the keyword. a and b are variable names.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!