a 'c' program to tell that the set of three coordinates lie
on a same line
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is floating point constants?
Convert the following expression to postfix and prefix (A+B) * (D-C)
FILE PROGRAMMING
int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }
main() { int x=5,y=10,z=0; x=x++ + y++; y=y++ + ++x; z=x++ + ++y; printf("%d%d%d\n",x,y,z); }
What are the different data types in C?
Can you please explain the difference between strcpy() and memcpy() function?
write a program for size of a data type without using sizeof() operator?
22 Answers HCL, IBM,
2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is the scope of static variable in c?