+ 1
in c++,If i want multiple line breaks how could i get it.
For example, cout << "hello world "; if i need 5 line breaks , cout << "hello world \n\n\n\n\n " insted of typing \n five times....is there any easy method ?
5 Answers
+ 3
You can use loop:
for(int i=1;i<=5;i++)
{
std::cout<<"\n";
}
+ 1
@jacob , yeah it \n makes a line break..but if u need 100 line breaks...are u dare to type 100 of \n ? so far the 1st answer ( using for loop ) seems fine
+ 1
simply no..
0
cout<<endl; five times
beyond that idk.
0
\n makes a line break