I have just started learning c programming.
For the question, I wrote the following code. Can you please help me find the error? I am not getting the desired result and the statement in the last else gets executed always.
#include<stdio.h>
#include<conio.h>
void dummy(float *a)
{
float b=*a; //perform some floating access
dummy (&b); //calling a floating point function
}
void main()
{
double x,y;
clrscr();
scanf("%lf %lf",x,y);
if(x==0 && y!=0)
{
printf("The point lies on the y-axis.");
}
else if(y==0 && x!=0 )
{
printf("The point lies on the x-axis.");
}
else if(x==0 && y==0)
{
printf("The point is the origin");
}
else
{
printf("The point lies neither on the x nor the y axis ");
}
getch();
}