Tuesday 21 August 2012

Loop control structure047

Write a program to construct  the image shown below.
                           1
                           2 2
                           3 3 3
                           4 4 4 4
                           5 5 5 5 5
                           6 6 6 6 6 6
                           7 7 7 7 7 7 7
                           8 8 8 8 8 8 8 8
                           9 9 9 9 9 9 9 9 9

#include <stdio.h>
#include <conio.h>

void main ( )
{
          int          i, j;
          clrscr ( );
                                     
          printf ("\n\t\t\t   Design of Numbers");
          printf ("\n\n\n\t\t\t  ");
                                          
          for ( i = 1; i <= 9; i++ )
          {                                  
                          for ( j = 1; j <= i; j++ )
                          {                                
                                          printf (" %d", i);
                          }
                          printf ("\n\t\t\t  ");
          }
          getch ( );
}



Click here to contact us 

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...