#include<stdio.h>
#include<conio.h>
void main()
{
int x1,y1,x2,y2,x3,y3,value;
printf("Enter the X co-ordinate of the First Point: ");
scanf("%d",&x1);
printf("Enter the Y co-ordinate of the First Point: ");
scanf("%d",&y1);
printf("\nEnter the X co-ordinate of the Second Point: ");
scanf("%d",&x2);
printf("Enter the Y co-ordinate of the Second Point: ");
scanf("%d",&y2);
printf("\nEnter the X co-ordinate of the Third Point: ");
scanf("%d",&x3);
printf("Enter the Y co-ordinate of the Third Point: ");
scanf("%d",&y3);
value = x1 * (y2-y3)
+ x2 * (y3-y1)
+ x3 * (y1-y2);
if(value == 0)
printf("\nPoints are Collinear.");
else
printf("\nPoint are Non Collinear.");
getch();
}
#include<conio.h>
void main()
{
int x1,y1,x2,y2,x3,y3,value;
printf("Enter the X co-ordinate of the First Point: ");
scanf("%d",&x1);
printf("Enter the Y co-ordinate of the First Point: ");
scanf("%d",&y1);
printf("\nEnter the X co-ordinate of the Second Point: ");
scanf("%d",&x2);
printf("Enter the Y co-ordinate of the Second Point: ");
scanf("%d",&y2);
printf("\nEnter the X co-ordinate of the Third Point: ");
scanf("%d",&x3);
printf("Enter the Y co-ordinate of the Third Point: ");
scanf("%d",&y3);
value = x1 * (y2-y3)
+ x2 * (y3-y1)
+ x3 * (y1-y2);
if(value == 0)
printf("\nPoints are Collinear.");
else
printf("\nPoint are Non Collinear.");
getch();
}
No comments:
Post a Comment