Hi! Guys. Here I am presenting you playing with codes. What you want you can do with programming. This is given a simple C++ code to wish your beloved "Happy Diwali".
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int i,j,k;
cout<<"\n\n\n";
for(i=1;i<=3;i++)
{
cout<<"\n\t\t";
for(j=1;j<=3-i;j++)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
for(i=3;i>=1;i--)
{
cout<<"\n\t\t";
for(j=3-i;j>=1;j--)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
for(i=9;i>=6;i--)
{
cout<<"\n\t ";
for(j=9-i;j>=1;j--)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
cout<<"\n\n";
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
cout<<" APPY\n";
for(i=0;i<1;i++)
{
cout<<"\n\t\t\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
for(i=0;i<4;i++)
{
cout<<"\n \t\t\t";
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
cout<<" IWALI.....";
for(i=0;i<1;i++)
{
cout<<"\n\t\t\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
cout<<"\n\t\t\t\t\t.........From\n\t\t\t\t\t\t -ASD";
getch();
return 0;
}
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int i,j,k;
cout<<"\n\n\n";
for(i=1;i<=3;i++)
{
cout<<"\n\t\t";
for(j=1;j<=3-i;j++)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
for(i=3;i>=1;i--)
{
cout<<"\n\t\t";
for(j=3-i;j>=1;j--)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
for(i=9;i>=6;i--)
{
cout<<"\n\t ";
for(j=9-i;j>=1;j--)
{
cout<<" ";
}
k=0;
while(k!=2*i-1)
{
cout<<"*";
k++;
}
}
cout<<"\n\n";
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
for(i=0;i<2;i++)
{
cout<<"\n\t";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
cout<<" APPY\n";
for(i=0;i<1;i++)
{
cout<<"\n\t\t\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
for(i=0;i<4;i++)
{
cout<<"\n \t\t\t";
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
cout<<" ";
for(j=0;j<2;j++)
{
cout<<"*";
}
}
cout<<" IWALI.....";
for(i=0;i<1;i++)
{
cout<<"\n\t\t\t";
for(j=0;j<7;j++)
{
cout<<"*";
}
}
cout<<"\n\t\t\t\t\t.........From\n\t\t\t\t\t\t -ASD";
getch();
return 0;
}
0 comments:
Post a Comment