a 'c' program to tell that the set of three coordinates lie
on a same line
Answer Posted / 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 |
Post New Answer View All Answers
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
Why c is called procedure oriented language?
How arrays can be passed to a user defined function
What are the two types of structure?
How can I call fortran?
What is the difference between variable declaration and variable definition in c?
What is c language and why we use it?
What is the difference between far and near ?
What is a pointer and how it is initialized?
What is difference between scanf and gets?
Write a program to check palindrome number in c programming?
Explain how do you determine the length of a string value that was stored in a variable?
Explain why can’t constant values be used to define an array’s initial size?
What are the usage of pointer in c?
What is the use of static variable in c?