This is C program that asks user to find the area of a triangle using math’s function. Here user declares some variables that use to store the value of it. User asks to enter the value of triangle three sides of triangle. Here after value user using the method to find the area of triangle. And then print the result on the screen.
This is C program that asks user to find out the area of triangle.
- Declare the variable.
- Using method of Triangle area function.
- Display result on the screen.
Method of Find area of Triangle:
" Area=sqrt(s*(s-a)*(s-b)*(s-c)); "
Here is C source code for finding the area of triangle. The output of this program shown below.
float area, s;
printf("Enter the Three Sides of Triangle : ");
scanf("%d %d %d" ,&a, &b, &c);
printf("Area of the Triangle= %f ", area);