#include <iostream>
using namespace std;
int main() {
for(int n=0;n<10;n++) { //sets n = 0, tells the loop to stop when n is no longer below 10, tell n to increment by 1 every time it loops.
cout << "n is " << n << ": "; //prints out string "n is " followed by the value for n at this point
for(int m=0; m<=n; m++) { //sets m = 0, tells the loop to stop when m>n, tells m to increment by +1 each cycle
cout << m; //prints out the value for m
}
cout << endl; //moves to next line
}
return 0 ; //exits program
}
OUTPUT:
n is 0: 0
n is 1: 01
n is 2: 012
n is 3: 0123
n is 4: 01234
n is 5: 012345
n is 6: 0123456
n is 7: 01234567
n is 8: 012345678
n is 9: 0123456789