" Learn Free Coding contains well written, well thought, well explained and easily Understandable computer science articles, Learn C, Java, Python, HTML, C# & everything else. "

How To Write Code For Finding Area Of Triangle In 'C' Language ?

MOST EASY AND UNDERSTANDABLE WAY ,,,[ बिलकुल  आसान  तरीका  ]


LET  SEE  "C"  ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓



#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
                                                                           


How To Write Code For Finding Area Of Triangle In 'C' Language ? How To Write Code For Finding Area Of Triangle In 'C' Language ? Reviewed by Shaishav Anand on February 06, 2019 Rating: 5

3 comments:

Powered by Blogger.