HI! I am new to programming (*although i know some html*) and I was wondering if someone could tell me what is wrong with my C++ area calculator? Thanks!
#include <iostream>
using namespace std;
int main (int argc, char **argv)
{
int height;
int width;
int area = height*width;
cout << "This program was written by Michael Keefe\n\n---------------------------------------------------------------- \n\nWhat is the height of the quadrilateral? \n" << endl;
cin >> height;
cout << "\nThankyou.\n\nThe height of the quadrilateral is: " << height << "\n\nPlease enter the width of the quadrilateral.\n" << endl;
cin >> width;
cout << "\nThankyou.\n\nThe height of the quadrilateral is: " << height << "\nThe width of the quadrilateral is: " << width << "\n\n-------------------------------------------------------\n\nThe area of the quadrilateral you specified is: " << area << endl;
cout << "\n\nThis program was developed by Michael Keefe" << endl;
system("pause");
return (0);
}
Every time I input something, it gives me the area as 152! Even 3x3!
Can someone help?