007. Write a program to print area of a triangle A(Triangle)= 0.5 * B * H in C language

 
#include<stdio.h>
#include<conio.h>
main()
{
 float AREA,B,H;
 clrscr();
 printf("Enter Base & Height: ");
 scanf("%f%f",&B,&H);
 AREA=0.5*B*H;
 printf("Area of the given is : %6.2f",AREA);
 getch();
}

7 thoughts on “007. Write a program to print area of a triangle A(Triangle)= 0.5 * B * H in C language

    1. This is for formatting your number. For e.g. if number is 234.47746 it will be formatted as 234.48. That will show numbers up to second digit post decimal point. I hope this helps you. Enjoy 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *