Answer:
#include <iostream>
using namespace std;
int main() {
cout<<"Printing by method 1"<<endl;
//using 1 output statement with one streaminsertion operator.
cout<<"1 2 3 4";
cout<<endl<<"Printing by method 2"<<endl;
//using 1 output statement with four stream insertion operator.
cout<<"1 "<<"2 "<<"3 "<<"4";
cout<<endl<<"Printing by method 3"<<endl;
//using four output statements.
cout<<"1 ";
cout<<"2 ";
cout<<"3 ";
cout<<"4 ";
return 0;
}
Output:-
Printing by method 1
1 2 3 4
Printing by method 2
1 2 3 4
Printing by method 3
1 2 3 4
Explanation:
The above code is as per the question given.All the three methods are implemented as per the question.