Pattern 8

// Pyramid

#include<stdio.h>
void main()
{
int i,j,k=1;
for(i=1;i<=6;i++) //for loop that prints numbers.
{
for(j=6-i;j>=1;j--)
{
printf("%d",j);
}
for(k=1;k<i;k++)
{
printf("%d",k);
}
printf("\n");
}
}

Comments

Popular Posts