this is a program for finding if 2 lines are parallelCode:#include<stdio.h> #include<conio.h> int main() { int x1,y1,x2,y2,a[2],c[2],d=1; gh: printf("insert x1,y1,x2,y2\n"); scanf("%d\n%d\n%d\n%d\n",&x1,&y1,&x2,&y2); a[d]=(y2-y1)/(x2-x1); c[d]=y1-a[d]*x1; printf("y=%dx+%d\n",a[d],c[d]); d++; if(d<=2) { goto gh; } else { if (a[1]==a[2]) { printf("they are parallel"); } } getch(); }
when user enters the co-ordinates of 2 points on the line
it is working well
but when the user is supposed to enter 4 datas only it asks for a fifth data which seems to have no effect on the program. but why is this happening????
plz help!!!!!!!!!
pst: i am using dev c++