Program:
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,a,n,s,p;
printf("Enter the no. of lines:");
scanf("%d",&n);
a=n;
j=1;
for(i=1;i<=n;i++)
{
for(k=1;k<=(a-1);k++)
printf(" ");
a--;
for(k=1,p=1;k<=(i-1);)
{
if((!(k%10)^0))
p=0;
printf("%d",p);
k++;p++;
}
if(!((i%10)^0))
j=0;
printf("%d",j);
s=--p;
if(i>10)
{
for(s>0;s--;)
printf("%d",s);
printf("\n");
}
getch();
}
}
Output:
Now, press Enter
Now, press Enter
Now, press Enter
Now, press Enter