Thursday, 17 October 2013

CPP Program to Calculate Area of Right Angle Triangle

//Write a program to calculate area of right angle triangle.
#include<iostream.h>
#include<conio.h>

void main()
{
 clrscr();
 int h,b,area;
 cout<<"Enter perpendicular height -";
 cin>>h;
 cout<<"Enter base of the triangle -";
 cin>>b;
 area=h*b*0.5;
 cout<<"Area of triangle -"<<area;
 getch();
}

Output:

No comments:

Comments System