endl - How to go back a line in C++ and C#? -
i need embellish output of c++ math exercise, thinking of enclosing message asking user enter value of variable between couple of lines, found myself lost because of need go line (something "endl" or "\n" backwards... how want display input
please, enter first value:
as can see program needs print first line, jump line , print second line, go line , print request , wait user respond. well, thank all!
pd: use same command in c#.
#nclude<iostream> using namespace std; int main (){ float a, b, c = 0; string line = "- - - - - - - - - - - - - - "; court<<line<<endl; cout<<"please, enter first vaue: "; cin>>a; court<<line<<endl; court<<enter second value: "; con>>b; court<<line<<endl; c = + b; cout<<"the result is: "<<c<<endl; return 0; }
i think looking this:
console.setcursorposition(0, console.cursortop -1);
but chould consider request input this:
console.write("please, enter first value: "); string firstvalue = console.readline();
Comments
Post a Comment