Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that prompts the user for an x and a y coordinate in the Cartesi

ID: 3648570 • Letter: W

Question

Write a program that prompts the user for an x and a y coordinate in the Cartesian plane
and prints out a message indicating if the point (x; y) lies on an axis (x or y axis, or both) or what
quadrant it lies in

Explanation / Answer

float x,y; scanf("%f%f",&x,&y); if(x ==0 && y==0){ printf("origin"); } if(x == 0){ printf("point lies on y axis"); } else if(y == 0){ printf("point lies on x axis"); } else if(x > 0){ ...............if(y > 0){ .........................printf("1st quad"); .........................} .............else{ ..................printf("4th quad"); .................} .............} else { ......if(y > 0){ .............printf("2nd quad"); ................} ......else { ...........printf("3 rd quad"); ...........} .....}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote