Write a program that inputs base and height from the user amd calculates area of a triangle.

 

#include<stdio.h>

#include<conio.h>

int main()

{

clrscr();

int height,base;

float area;

printf(“Enter the Height: “);

scanf(“%d”,&height);

printf(“Enter the Base: “);

scanf(“%d”,&base);

area=(base*height)/2;

printf(“The Area is : %0.2f”,area); //%f is used for float data type and 0.2 in b/w them is used for to print two after integer.

getch();

return 0;

}