← Back to If Statements
Question 212
Which City Is Warmer
Which City Is Warmer
Two temperatures are stored in fixed variables: cityA is 15 and cityB is 22. Compare them and print which city is warmer. Print City A is warmer if cityA has the higher temperature, City B is warmer if cityB is higher, or Both cities are the same if the two temperatures are equal. This is a three-way decision, so use if / else if / else.
Expected Output:
City B is warmer= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.