1 /* to check whether all the three points lie on a straight line */
9 printf("Enter X1,Y1:");
10 scanf("%d %d",&x1
,&y1
);
12 printf("Enter X2,Y2:");
13 scanf("%d %d",&x2
,&y2
);
15 printf("Enter X3,Y3:");
16 scanf("%d %d",&x3
,&y3
);
18 /*compute the area formed by these three points. if
19 it is zero , then they all lie on a same line i.e they don form a triangle */
20 area
= (1/2)*((x1
*(y2
-y3
))+(x2
*(y3
-y1
))+(x3
*(y1
-y2
)));
23 printf("They lie on a straight line\n");
25 printf("They dont lie on a straight line\n");
27 printf("Press any key to exit\n");