Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //given a point (x,y) WAP to find if it lies in x-axis, y-axis or center
- //include the standard lib
- #include<stdio.h>
- //main is a collective name for set of instructions
- main()
- {
- //declare types for point info
- int x1,y1;
- printf("Check which axis the point lies in\n");
- printf("\n---------------------------------\n");
- printf("Provide circle info\n");
- printf("x1: \t");
- scanf("%d",&x1);
- printf("y1: \t");
- scanf("%d",&y1);
- //compute the condition with if
- if(x1==0&&y1==0)
- printf("the point (%d,%d) lies on origin\n",x1,y1);
- else if(x1==0)
- printf("The point (%d,%d) lies on x-axis\n",x1,y1);
- else if(y1==0)
- printf("the point (%d,%d) lies on y-axis\n",x1,y1);
- }
Add Comment
Please, Sign In to add comment