#include<stdio.h>
int main()
{
int n,a,b,c,d,i,j;
b=-1;
printf("Enter value of n\n");
scanf("%d",&n);
c=0;
a=0;
for(i=1;i<=n;i++)
{
for(j=n-i;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
a = c+22+16*b;
printf("%05d\t",(a));
c=a;
b++;
}
printf("\n");
}
return 0;
}
int main()
{
int n,a,b,c,d,i,j;
b=-1;
printf("Enter value of n\n");
scanf("%d",&n);
c=0;
a=0;
for(i=1;i<=n;i++)
{
for(j=n-i;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
a = c+22+16*b;
printf("%05d\t",(a));
c=a;
b++;
}
printf("\n");
}
return 0;
}
Output
0028
0066 00.......
No comments:
Post a Comment