[ad_1]
You can use
if (a != 2)
cout<<"2*";
else
cout<<"2";
instead of cout<<"2*";
[ad_2]
solved How to prevent a final cout in a loop from being executed?
[ad_1]
You can use
if (a != 2)
cout<<"2*";
else
cout<<"2";
instead of cout<<"2*";
[ad_2]
solved How to prevent a final cout in a loop from being executed?