Pages

Saturday, 13 June 2015

Number Pattern 4

Number Pattern 4

Coding:

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

Output:
Please enter number of lines:5

1
23
345
4567
56789