How to use endl after if statement

I'm trying to make a blank line after my if statement, but for some reason it isn't making a blank like. I tried putting the cout << endl; in the statement and outside of it. if anyone can help me itd be appreciated!

Here is my code. Creating a blank space outside of the second if statement is what im trying to do down at the bottom. The ways ive tried just dont make a blank line for some reason

if (!inData)
{
cout << "This file does not exist" << endl;
<< endl;

return 1;
}
else
{
if(driving > flying)
{
cout << "The faster time is driving (" << driving << ") and then "
"flying (" << flying << ')';
}
else
{
cout << "The faster time is flying (" << flying << ") and then "
"driving (" << driving << ')';
}

cout << endl;
cout << setw(14) << "start" << setw(10) << "finish" << endl;
}

To make a blank line, just insert cout << endl; and that's it.
Another way for a blank line is

cout << " statement" << endl;
Last edited on
@Morlok
That will echo two blank lines.
you can also try cout << " " << endl;
Topic archived. No new replies allowed.