Three Independent Ifs, Then Done
easyQuestion 201The variable x is 50. Write three separate if statements (not an else-if chain) that check, in this order: whether x is exactly 50, whether x is greater than 10, and whether x is less than 10. Each true check prints its own line: Equals 50, Greater than 10 and Less than 10. After all three ifs, print Done. Only the checks that are true print, so the output has three lines here.
Expected output
Equals 50 Greater than 10 Done
= newline. The output ends with a newline, so print one after the last line.
Hints3 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 (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.