This one seems really simple but for some reason I'm not getting it! Here's the problem:
USING A FOR LOOP, read 4 lines of input from the user and display it on the screen.
I made my code, which works, but it only reads the first line the user has inputted. It displays only that line 4 times instead of the 4 different lines.
Thanks!
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string input;
getline (cin,input);
for (int x = 1; x <= 4; x++)
{
cout << input << endl;
}
return 0;
}