Hello friends,how are you????Enjoying my blogs or not??Today i'm sharing an interesting program i know you will take enjoy when read this code,i try to make this code very easy specialy for all of you.....
1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 1
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,l;
clrscr();
printf("\n HERE IS YOUR PATTERN:\n");
l=11;
for(i=1;i<=6;i++)
{
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
for(k=1;k<=l;k++)
printf(" ");
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=l-2;
}
for(i=1;i<=13;i++)
{
if(i%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=1;
for(i=6;i>=1;i--)
{
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
for(k=1;k<=l;k++)
printf(" ");
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=l+2;
}
getch();
return(0);
}
Thanks Friends....
No comments:
Post a Comment
Please Give Me Your Views