This will print out something like this
1
2*2
3*3*3
4*4*4*4
and then the reverse image.
If you have any doubt, please do ask.
#include<stdio.h>
main()
{
int i=1,j=2,z=4,k;
printf("%d\n",i);
for(k=0;k<3;k++)
{
for(i=2;i<z-1;i++)
{
printf("%d*",j);
}
printf("%d\n");
j++;
z++;
}
j=4;
for(k=0;k<3;k++)
{
for(i=2;i<z-2;i++)
{
printf("%d*",j);
}
printf("%d\n");
j--;
z--;
}
printf("%d",1);
}
1
2*2
3*3*3
4*4*4*4
and then the reverse image.
If you have any doubt, please do ask.
#include<stdio.h>
main()
{
int i=1,j=2,z=4,k;
printf("%d\n",i);
for(k=0;k<3;k++)
{
for(i=2;i<z-1;i++)
{
printf("%d*",j);
}
printf("%d\n");
j++;
z++;
}
j=4;
for(k=0;k<3;k++)
{
for(i=2;i<z-2;i++)
{
printf("%d*",j);
}
printf("%d\n");
j--;
z--;
}
printf("%d",1);
}
No comments:
Post a Comment