#include <iostream>
int main(){
using namespace std;
string s1("Hello1");
string s2("Hello2");
for(int i = 0; i < 3; i++){
cout.width(20); cout<<"Some String:"<<left<<s1<<endl;
cout.width(20); cout<<"Another String:"<<left<<s2<<endl;
cout<<endl;
}
return 0;
}
Here is my code. It, to my knowledge, should print s1 and s2 20 characters from the very left of the screen. However, it prints
Some String:Hello1
Another String: Hello2
Some String: Hello1
Another String: Hello2
Some String: Hello1
Another String: Hello2
I am using onlineGDB to compile, as per instruction of my teacher. What error am I making?