need to write a specified amount of digit

hi,

im trying to write an output of 10 ones // or more
1111111111


i tried

1
2
for (int i = 1;;)//maybe something to put here ??
cout << i;



obviously its not gonna work ...any one know how to do it ??

thanks in advance
1
2
3
4
for (int i=0; i < 10; i++)
{
   cout << "1";
}
nice !! thank you sir
Another way

std::cout << std::string( 10, '1' ) << std::endl;
Topic archived. No new replies allowed.