Monday, 1 September 2014

Ascending descending pattern

#include<conio.h>
#include<stdio.h>
main()
{
int i,j,k,l;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);

}printf("\n");

}
for(k=5;k>=1;k--)
{
for(l=k;l>=1;l--)
{
printf("%d",l);

}
printf("\n");
}
getch();
return 0;
}




No comments:

Post a Comment