C program to print number pattern

/*                                      C program to print following number pattern
                                                               codeMystery()                                         */


1
12
123
1234
12345

Program:

#include<stdio.h>

void main()
{
int rows, i, j;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for(i=1; i<=rows; i++)
{
for(j=1; j<=i; j++)
{
printf("%d", j);
}
printf("\n");
}


}

Output:




Comments

Popular Posts