Saturday 18 August 2012

Loop control structure034

Write a program to construct  the image shown below.
                         01020304
                         05060708
                         09101112
                         13141516


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

void main ( )
{
            int    i, j, c =1;
            clrscr ( );
               
            printf ("\n\t\t\t   Designee of Numbers");
            printf ("\n\n\n\t\t\t\t");
                      
            for ( i = 1; i <= 4; i++ )
            {                       
                            for ( j = 1; j <= 4; j++ )
                            {             
                                            if ( c < 10)
                                                       printf ("0%d", c);
                                            else                      
                                                       printf ("%d", c);
                                            c++;
                            }
                            printf ("\n\t\t\t\t");
            }
            getch ( );
}



Click here to contact us

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...