xxxxxxxxxx
* | 1 | A
* * * | 1 2 3 | A B C
* * * * * | 1 2 3 4 5 | A B C D E
* * * * * * * | 1 2 3 4 5 6 7 | A B C D E F G
* * * * * * * * * | 1 2 3 4 5 6 7 8 9 | A B C D E F G H I
* * * * * * * | 1 2 3 4 5 6 7 | A B C D E F G
* * * * * | 1 2 3 4 5 | A B C D E
* * * | 1 2 3 | A B C
* | 1 | A
xxxxxxxxxx
#include<stdio.h>
int main(){
for(int i =0; i<=5; i++)//loop responsible for writing columns
{
for(int j = 0; j<=i; j++)//loop responsible for writing rows
{
printf("%d ", j);
}
printf("\n");
}
}
//output
/*
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5
*/