i dont know what kind of figure is this:
1
12
123
1234
12345
or
54321
4321
321
21
1
how could i do a c++ program of it???
1
12
123
1234
12345
or
54321
4321
321
21
1
how could i do a c++ program of it???
#include <stdio.h>
#include <conio.h>
int main()
{
int i,j,k;
clrscr();
printf("Enter the No :");
scanf("%d",&k);
i=1;
j=i+1;
printf("%d\n",i);
do
{
for(i=1;i<=j;i++)
{
printf("%d",i);
}
j=i;
printf("\n");
}while(j<=k);
getch();
return 0;
}
Comment