    #include <stdio.h>
    #include <stdlib.h>
/*

    This program calculates the area of the triangle for you, whenever you plug in the (x,y) coordinates of the triangle

*/

    int main()

{

    float x1;
    float y1;
    float x2;
    float y2;
    float x3;
    float y3;
    float area;

    printf("Input the x-coordinate of the first point x1\n");
    scanf("%f", &x1);

    printf("Input the y-coordinate of the first point y1\n");
    scanf("%f", &y1);

    printf("Input the x-coordinate of the second point x2\n");
    scanf("%f", &x2);

    printf("Input the y-coordinate of the second point y2\n");
    scanf("%f", &y2);

    printf("Input the x-coordinate of the third point x3\n");
    scanf("%f", &x3);

    printf("Input the y-coordinate of the third point y3\n");
    scanf("%f", &y3);

    area=fabs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2)))/2;

    printf("the area of the triangle is %f\n", area);

    system("PAUSE");



    return 0;
}


