Formatting numbers in loop
- by dave9909
I want to list all numbers from 0000-9999 however I am having trouble holding the zero places.
I tried:
for(int i = 0; i <= 9999; ++i)
{
cout << i << "\n";
}
but I get: 1,2,3,4..ect
How can I make it 0001,0002,0003....0010, etc