Ads 468x60px

Labels

Wednesday, 12 September 2012

Simplified pattern code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,a=4;
clrscr();
for(i=0;i<5;i++)
{
for(j=0;j<9;j++)
{
if((j>7-i||j<i+1)
printf("%d ",a);
else
printf("  ");
}
printf("\n");
a--;
}
getch();
}