-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment 1.cpp
More file actions
46 lines (46 loc) · 909 Bytes
/
assignment 1.cpp
File metadata and controls
46 lines (46 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//WAP that reads a co-ordinate point of rectangular co-ordinate system
//and display the appropriate message after checking where the point lies on the co-ordinate system.
#include <stdio.h>
int main()
{
float x,y;
printf(" enter the position x and y \n");
scanf("%f%f", &x,&y);
if (x>0 && y>0)
{
printf(" first quadrant");
}
else if(x>0 && y<0)
{
printf(" fourth quadrant");
}
else if(x<0 && y>0)
{
printf("second quadrant");
}
else if(x<0 && y<0)
{
printf(" third quadrant");
}
else if(x>0 && y==0)
{
printf(" +ve x-axis");
}
else if (x<0 && y==0)
{
printf(" -ve x-axis");
}
else if (y>0 && x==0)
{
printf(" +ve y -axis");
}
else if(y<0 && x==0)
{
printf(" -ve y-axis");
}
else
{
printf(" origin");
}
return 0;
}