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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -