#include<iostream.h>
#include<conio.h>
void main()
{
float b ;
float h ;
clrscr();
cout<<"\nFinding Area of Triangle";
cout<<"\n---------------------------";
cout<<"\nEnter the value of Base (then press ENTER key) : ";
cin>>b;
cout<<"Enter the value of Height (then press ENTER key): ";
cin>>h;
cout<<"\n\nFormula:";
cout<<"\nArea of Triangle = 1/2(Base * Height)";
cout<<"\n\nResult:";
cout<<"\nArea of Triangle = "<<b*h*0.5;
cout<<"\n---------------------------";
cout<<"\n\n\nPress any key to Exit";
getche() ;
}
#include<conio.h>
void main()
{
float b ;
float h ;
clrscr();
cout<<"\nFinding Area of Triangle";
cout<<"\n---------------------------";
cout<<"\nEnter the value of Base (then press ENTER key) : ";
cin>>b;
cout<<"Enter the value of Height (then press ENTER key): ";
cin>>h;
cout<<"\n\nFormula:";
cout<<"\nArea of Triangle = 1/2(Base * Height)";
cout<<"\n\nResult:";
cout<<"\nArea of Triangle = "<<b*h*0.5;
cout<<"\n---------------------------";
cout<<"\n\n\nPress any key to Exit";
getche() ;
}
No comments:
Post a Comment