Monday 20 August 2012

Loop control structure046

Write a program to construct  the image shown below.
                                     2222
                                     4444
                                     6666
                                     8888

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

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