100% area of traingle using Heron's formula
// area of triangle according to Heron's formula
#include <stdio.h>
#include<math.h>
void main()
{
float a,b,c,s,area;
printf("\n enter the sides of the triangle in proper units:");
scanf("%f%f%f",&a,&b,&c);
s=(a+b+c)/2.0; //s=semi-perimeter
printf("area of traingle with 3 given side lengths=%f sq units",sqrt(s*(s-a)*(s-b)*(s-c)));
}// end of main
ఔట్పుట్ తెరమీద
#include <stdio.h>
#include<math.h>
void main()
{
float a,b,c,s,area;
printf("\n enter the sides of the triangle in proper units:");
scanf("%f%f%f",&a,&b,&c);
s=(a+b+c)/2.0; //s=semi-perimeter
printf("area of traingle with 3 given side lengths=%f sq units",sqrt(s*(s-a)*(s-b)*(s-c)));
}// end of main
ఔట్పుట్ తెరమీద
enter the sides of the triangle:3 4 5
area of traingle with 3 given side lengths=6.000000 sq units
area of traingle with 3 given side lengths=6.000000 sq units
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.