a 'c' program to tell that the set of three coordinates lie
on a same line

Answers were Sorted based on User's Feedback



a 'c' program to tell that the set of three coordinates lie on a same line..

Answer / vamshi krishna

write a code that checks area of triangle formula i.e
x1(y3-y2)+x2(y1-y3)+x3(y2-y1)=0.

if zero points lie on same line

Is This Answer Correct ?    27 Yes 2 No

a 'c' program to tell that the set of three coordinates lie on a same line..

Answer / chetan kole

m1=(y2-y1)/(x2-x1);
m2=(y3-y2)/(x3-x2);
if(m1==m2)
{
printf("3 points are on same line")
}
else
{
printf("not on same line");
}

Is This Answer Correct ?    19 Yes 5 No

a 'c' program to tell that the set of three coordinates lie on a same line..

Answer / chetan kole

m1=(y2-y1)/(x2-x1);
m2=(y3-y2)/(x3-x2);
if(m1==m2)
{
printf("3 points are on same line")
}
else
{
printf("not on same line");
}

Is This Answer Correct ?    10 Yes 5 No

Post New Answer

More C Interview Questions

what's the return value of malloc()

9 Answers  


Write a program to generate prime factors of a given integer?

9 Answers   Microsoft,


what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question

6 Answers  


Explain 'far' and 'near' pointers in c.

0 Answers  


while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?

4 Answers   Aptech,






int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,


what are the advantages of a macro over a function?

0 Answers   TCS,


main() { int a,b; printf("%d,%d",scanf("%d%d",&a,&b)); } => do u mean above program's output... =>output will be:2,whatever you enter value for b. =>because scanf is a library fn which will return how many arguements it processes, and second value you are right mr.Satya but i found my self unable to understand that for the first time scanf returns the no of successful matches but how for the second time it returns the value of 'b'.while a function should return the same 'r' value every time.

1 Answers   Cisco,


What is a header file?

0 Answers  


Total of how many functions are available in c?

3 Answers  


A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.

4 Answers  


write a function to swap an array a[5] elements like a[0] as a[5],a[1] as a[4],....a[5] as a[0].without using more than one loop and use one array not to use temp array?

1 Answers   Zensar,


Categories