I am having problems with the console window reading input. As an example, when I run the program below, the console window will ask for the width only. The program will continue running indefinitely and never ask for the length. Please advise. When I run the program from the terminal, there are no problems.
#include <iostream>
using namespace std;
int main(){
double width,length;
cout << "Enter width of rectangle ";
cin >> width;
cout << "Enter length of rectangle ";
cin >>length;
cout << " Area is " << width*length << endl;
}
Thanks for the help!
#include <iostream>
using namespace std;
int main(){
double width,length;
cout << "Enter width of rectangle ";
cin >> width;
cout << "Enter length of rectangle ";
cin >>length;
cout << " Area is " << width*length << endl;
}
Thanks for the help!