Pages

Sunday, 14 June 2015

Number pattern 7

Number pattern 7

Coding:
#include<stdio.h>
int main()
{
int i,j,n;
printf("Please enter number of lines:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}

Output:
Please enter number of lines:5
54321
5432
543
54
5