sahajjain01

Calculate area of a triangle.

Aug 4th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. //Program to calculate area of a triangle.
  2. #include<iostream.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6.     clrscr();
  7.     float a,b;
  8.     cout<<"Enter height: ";
  9.     cin>>a;
  10.     cout<<"Enter base: ";
  11.     cin>>b;
  12.     a=0.5*a*b;
  13.     cout<<"Area of the triangle is: "<<a;
  14.     getch();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment