Area of Triangle Program in C Language | write a C program to calculate Area of Triangle

Spread the love

Formula to Calculate Area of Triangle :

Area = ½ × b × h
b = base
h = vertical height

Description :

Here is the Area of Triangle program, User need to Enter base and Height Values. program will generates Area of Triangle.

Program :

  1. /*Write a c program to find the area of any triangle*/
  2. #include<stdio.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6.     int ht,base,area;
  7.     clrscr();
  8.     printf(“Enter the height and base of the triangle”);
  9.     scanf(“%d%d”,&ht,&base);;
  10.     area=0.5*ht*base;
  11.     printf(nArea of the triangle is=%d”,area);
  12.     getch();
  13. }

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply