Showing posts with label Program to decide a quadrant of the entered point. Show all posts
Showing posts with label Program to decide a quadrant of the entered point. Show all posts

Program to decide a quadrant of the entered point

//Program to decide a quadrant of the entered point
#include<stdio.h>
#include<conio.h>
int main()
{
float a,b;
clrscr();
printf("Enter the Co-ordinate of the point as x,y\n");
scanf("%f\n%f",&a,&b);
if(a>0&&b>0) printf("The Point lies in First Quadrant");
if(a>0&&b<0) printf("The Point lies in the Forth Quadrant");
if(a<0&&b<0) printf("The Point lies in the Third Quadrant");
if(a<0&&b>0) printf("The Point lies in the Second Quadrant");
if(a==0&&b!=0) printf("The Point lies on the X Axis");
if(a!=0&&b==0) printf("The Point lies on the Y Axis");
if(a==0&&b==0)printf("The Point is an Origin");
getch();
return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.