MOST EASY AND UNDERSTANDABLE WAY ,,,[ बिलकुल आसान तरीका ]
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float a,b,c,s,area;
printf("enter the sides of the triangle");
scanf("%f%f%f",&a,&b,&c);
if((a+b>c)&&(a+c>b))
{
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("area of the triangle for given sides=%f",area);
}
else
{
printf("triangle is not valid");
}
getch();
}
THANKS
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float a,b,c,s,area;
printf("enter the sides of the triangle");
scanf("%f%f%f",&a,&b,&c);
if((a+b>c)&&(a+c>b))
{
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("area of the triangle for given sides=%f",area);
}
else
{
printf("triangle is not valid");
}
getch();
}
THANKS
How To Write Code For Finding Area Of Triangle In 'C' Language ?
Reviewed by Shaishav Anand
on
February 06, 2019
Rating:
Most useful
ReplyDeleteThanks
DeleteThanks
ReplyDelete