[ create a new paste ] login | about

Link: http://codepad.org/xrQvUfVy    [ 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
2
3
4
5
6
7
Line 20: error: iostream: No such file or directory
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 10: error: 'cout' undeclared (first use in this function)
Line 10: error: (Each undeclared identifier is reported only once
Line 10: error: for each function it appears in.)
Line 10: error: 'endl' undeclared (first use in this function)


Create a new paste based on this one


Comments: