how to write a c program using a function to determine the position of points in the xy coorddinate system
Answers
Answer:
blah blah
Explanation:
Answer:
Here is source code of the C program to read a coordinate point in a XY coordinate system and determine its quadrant. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C program to accept a coordinate point in a XY coordinate system
* and determine its quadrant
*/
#include <stdio.h>
void main()
{
int x, y;
printf("Enter the values for X and Y\n");
scanf("%d %d", &x, &y);
if (x > 0 && y > 0)
printf("point (%d, %d) lies in the First quandrant\n");
else if (x < 0 && y > 0)
printf("point (%d, %d) lies in the Second quandrant\n");
else if (x < 0 && y < 0)
printf("point (%d, %d) lies in the Third quandrant\n");
else if (x > 0 && y < 0)
printf("point (%d, %d) lies in the Fourth quandrant\n");
else if (x == 0 && y == 0)
printf("point (%d, %d) lies at the origin\n");
}
Explanation: