Monday 20 August 2012

Loop control structure040

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

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

void main ( )
{
          int          i, j;
          clrscr ( );
                        
          printf ("\n\t\t\t   Designee of Numbers");
          printf ("\n\n\n\t\t\t  ");
                           
          for ( i = 9; i >= 1; i-- )
          {                                 
                          for ( j = i; j >= 1; 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...