0
Can I remove the space between two lines in c ++?
8 Answers
+ 2
It looks like this as I ran it ...
*****
*****
*****
*****
*****
I don't know if it's possible if you want the stars to appear more condensed (row wise).
+ 2
You mean like joining a two line string into one?
Hello
world
Into
Hello world
But the string was separated into lines by new line character '\n' rather than space ' '. So I'm not sure what you want here.
+ 2
Perhaps check the code for unnecessary `endl` or '\n'?
Can you share your code link for better comprehension?
0
No my mean when I print two stars using cout in two different lines then a huge space between first line and second line I want to remove it. *
*
0
Okk
0
#include<iostream>
Int main()
{
int I,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}
0
In this program when a line end and new line start then a huge space between them due to endl
Can I reduce it.