fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. int x1,x2,x3,y1,y2,y3,a;
  7. float p;
  8.  
  9. printf("Enter the co-ordinates of frist vertix=");
  10. scanf("%d%d",&x1,&y1);
  11.  
  12. printf("\nEnter the co-ordinates of second vertix=");
  13. scanf("%d%d",&x2,y2);
  14.  
  15. printf("\nEnter the co-ordinates of third vertix=");
  16. scanf("%d%d",&x3,&y3);
  17.  
  18. a=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
  19. p=abs(a)/2;
  20.  
  21. printf("\nArea of triangle is=%f",a);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Enter the co-ordinates of frist vertix=
Enter the co-ordinates of second vertix=
Enter the co-ordinates of third vertix=
Area of triangle is=0.000000