Tuesday, August 13, 2019

Numeric pattern is the best prectice.

Numeric pattern is the best prectice:


pyramid pattern in cprograms.


     1
    321
   4321
  7654321
 987654321

#include<stdio.h>
#include<conio.h>

void main()
{
int i,j,k,l=1;
clrscr();
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf(" ");
}
for(k=l;k>=1;k--)
{
printf("%d",k);
}
l=l+2;
printf("\n");
}
getch();

}


EmoticonEmoticon