#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 quadrant\n”);
else if( x < 0 && y > 0)
printf(“point (%d,%d) lies in the Second quadrant\n”);
else if( x < 0 && y < 0)
printf(“point (%d, %d) lies in the Third quadrant\n”);
else if( x > 0 && y < 0)
printf(“point (%d,%d) lies in the Fourth quadrant\n”);
else if( x == 0 && y == 0)
printf(“point (%d,%d) lies at the origin\n”);
} /* End of main() */
/*———————————————
Output
RUN 1
Enter the values for X and Y
3 5
point (5,3) lies in the First quadrant
RUN 2
Enter the values for X and Y
-4
-7
point (-7, -4) lies in the Third quadrant
———————————————*/
Not Satisfied ? Just search & get the result
Related posts:
- C program (1-D Array) store some elements in it.Accept key & split from that point. Add the first half to the end of second half
- C program to accept two integers and check if they are equal
- C program to accept an array of integers and delete the specified integer from the list
- C Program to accept two matrices and check if they are equal
- C program to accept the height of a person in centimeter and categorize the person based on height as taller, dwarf and average height person
