{
int input;
cout<<"Please select a number from 0 to 127: ";
cin>>input;
if (input<127 && input>0)
MarkNumber(input);
else
cout<<"Please enter a number from 0 and 127!"<<endl;
}
void MarkNumber(int input)
{
int loop=0, n=0;
while (loop!=input)
{
cout<<n;
n++; //incrementing number from 0
loop++; //incrementing counter for loop
}
cout<<endl<<endl;
}
I need to use only numbers from 0-9. SO if the user inputs 13, the output should be 01234567890123 (repeating the 0-9) instead of 012345678910111213.
Any help is appreciated!