+ 5
[SOLVED] C++: Is there any way to insert a blank line after user input?
I'm writing a program in C++ that requires input in multiple locations of the program. Right now if I run it in Code::Blocks (where it prints line per line), the output is just one block of text for example: Enter a number. 2 (user input) Enter another number. But I was wondering if a blank line can be placed between the 2 in my example and the next user input prompt? I've tried cout << endl << endl; cout << "\n\n"; but neither seem to work. Thanks!
2 odpowiedzi
+ 5
N@G3
try
cout << " ";
or
cout << "\t\t";
+ 5
Okay, I forgot to put the code after the first user input which is why there was no blank line there and it looked like it didn't work 😆 (time for a break lol)
Either cout << endl; or cout << "\n"; works fine!