← Back to If Statements
Question 248
Quadrant Of A Point
Quadrant Of A Point
Read the x and then the y coordinate of a point and print which quadrant it is in: both positive is Quadrant 1, x negative and y positive is Quadrant 2, both negative is Quadrant 3, x positive and y negative is Quadrant 4, and a point with either coordinate equal to zero prints On an axis. Input: two lines, each an integer, no prompts. Output: one line. Each branch combines two comparisons with and.
Expected Output:
Quadrant 1= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
If StatementsOperators
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.