We don't normally like to do homework. You were close, but you put too much in the inner for loop if statment. Something like this might work better. Sometimes you just need to sit back and re-write your code while taking a different approach. There is ALWAYS a solution and something like this should be simple.
1 2 3 4 5 6
for (int a = 0; a < 4; a++) {
for (int b = 0; b < a+1; b++) {
cout << b + 3;
}
cout << endl;
}