WAP to illustrate the equal to and not equal to operator with if else

/*WAP to illustrate the equal to and not equal to operator with if else*/
#include<stdio.h>
#include<conio.h>

void main()

{
 int x,y;
 clrscr();
 printf("enter the value of x & y:\n");
 scanf("%d %d",&x,&y);

 if(x==0&&y==0)
  {
   printf("the point is origin");
  }
 else if(x==0&&y!=0)
  {
   printf("the point is on y-axis");
  }
 else if(y==0&&x!=0)
  {
   printf("the point is on x-axis");
  }
 else
   printf("the point is not on any axis");
 getch();
}

No comments:

Post a Comment