[ create a new paste ] login | about

Link: http://codepad.org/jhzub6qr    [ raw code | output | fork ]

C++, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
12
// prog02.cpp           put your name here             area of triangle
#include <iostream> 
using namespace std;
int main() 
{
float length, height, area;
length = 15.2;
height = 12.9;
area = height / 2 * length;
cout << "the area of a right triangle with height" << height << " and length" << length << " is " << area << endl;
return 0;
}


Output:
1
the area of a right triangle with height12.9 and length15.2 is 98.04


Create a new paste based on this one


Comments: