Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to calculate area of a triangle.
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- float a,b;
- cout<<"Enter height: ";
- cin>>a;
- cout<<"Enter base: ";
- cin>>b;
- a=0.5*a*b;
- cout<<"Area of the triangle is: "<<a;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment