How can i Keep "Enter" in the current line when receiving information from the user in the console by c++? -
int plus(){ int = 0, b = 0; cin >> a; cout << "\b + "; cin >> b; cout<<" = "<<a + b; return a+b;}
i want result printed on console in 1 line this: 1+2=3
don't use return this! suggest easy solution you. 3 variables. add c
variable keep result. and:
cout << <<"+" <<b << "=" << c <<endl;
//i see have named function "plus" believe use way. hope helps!
Comments
Post a Comment