+ 1
While Loop
Hello! I have the following code that outputs: 1 12 123 1234... depending on the number inputted. However, if you input 10 or greater, the code will output: .... 12345678910 1234567891011 123456789101112.... Is there anyway for it to output this instead: 1234567890 12345678901 123456789012... ? The code has to be two nested while loops. Thanks in advanced! https://code.sololearn.com/c42n6s0Bcd1M/?ref=app
1 Odpowiedź
+ 7
Line 14: change cout << k; to cout << k%10;