I'm writing a fairly simple program in C++ and i keep getting an error message when i try to compile it I don't see what I'm doing wrong if someone could look at this and point me in the right direction?
#inlcude <iostream>
using namespace std;
int main()
{
int length, width, area;
cout<<"This program calculates the area of a
";
cout<<"rectangle.\n";
cout<<"What is the length and width of the
rectangle ";
cout<<"separated by a space.\n";
cin >> length >> width;
area = length * width;
cout << "the area of the rectangle is " <<
area << endl;
return 0;
}
There is a typo Just replace the first line of code #inlcude <iostream> to #include <iostream> #include <iostream> using namespace std; int main() { int length, width, area; cout<<"This program calculates the area of a "; cout<<"rectangle.\n"; cout<<"What is the length and width of the rectangle "; cout<<"separated by a space.\n"; cin >> length >> width; area = length * width; cout << "the area of the rectangle is " << area << endl; return 0; }
Get Answers For Free
Most questions answered within 1 hours.