C program to print the number pattern

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


54321
5432
543
54
5


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=rows; j>=i; j--)
{
printf("%d", j);
}

printf("\n");
}
}


Output:


Comments

Popular Posts