Write a program to construct the image shown below.
000000000
111111111
000000000
111111111
000000000
111111111
000000000
111111111
000000000
000000000
111111111
000000000
111111111
000000000
111111111
000000000
111111111
000000000
#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 = 9; i >= 1; i-- )
{
for ( j = 9; j >= 1; j-- )
{
if ( i % 2 == 0 )
printf ( " 1");
else
printf ( " 0");
}
printf ("\n\t\t\t ");
}
getch ( );
}
Click here to contact us
No comments:
Post a Comment