#include <stdio.h>
#include <conio.h>
void main()
{
int r,s,c;
clrscr();
for(r=1;r<=5;r++)
{
for(s=1;s<=(5-r);s++)
printf(" ");
for(c=1;c<=r;c++)
printf("%2d",r);
printf("\n");
}
getch();
}

output:
                      1
                     2 2
                    3 3 3
                   4 4 4 4
                  5 5 5 5 5
Next
Newer Post
Previous
This is the last post.

Post a Comment

 
Top