Problem :
Can any one help me for this program.
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0,no=0;
clrscr();
printf("\n Please Enter The Number : - ");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=no;j>0;j--)
{
if(j<=i)
printf("%d",j);
}
}
getch();
}
Can any one help me for this program.
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0,no=0;
clrscr();
printf("\n Please Enter The Number : - ");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=no;j>0;j--)
{
if(j<=i)
printf("%d",j);
}
}
getch();
}
0 comments:
Post a Comment