adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Write a program in C to find area of triangle.

Write a program in C to find area of triangle.

 #include<stdio.h>  
 #include<conio.h>  
 #include<math.h>  
  void main()  
  {  
   float a,b,c,s,area;  
   clrscr();  
   printf("Enter three sides of a triangle:-");  
   scanf("%f%f%f",&a,&b,&c);  
   s=(a+b+c)/2;  
   area=sqrt(s*(s-a)*(s-b)*(s-c));  
   printf("Area of triangle=%.2f",area);  
   getch();  
   }  

Output:

Post a Comment

0 Comments