//___________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL _______________//
//____________ C++ PROGRAM TO WISH HAPPY DIWALI/DEEPAVALI _________________//
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<dos.h>
#include<math.h>
void main()
{
int i=0,gd=0, gm;
int j,kk;
int color;
int x,y;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setcolor(LIGHTGREEN);
line(0, 400, 640, 400);
setcolor(LIGHTCYAN);
rectangle(300, 330, 340, 400);
rectangle(310, 320, 330,330);
setcolor(YELLOW);
line(319, 280, 319, 398);
line(320, 280, 320, 398);
setcolor(LIGHTRED);
rectangle(320, 280, 330, 300);
outtextxy(340, 280, "PRESS ANY KEY TO IGNITE THE ROCKET");
getch();
for(j=400; j<640; j++)
{
cleardevice();
setcolor(LIGHTGREEN);
line(0, j, 640, j);
rectangle(300, j-70, 340, j);
rectangle(310, j-80, 330, j-70);
setcolor(LIGHTCYAN);
line(319, 280, 319, 400);
line(320, 280, 320, 400);
rectangle(320, 280, 330, 300);
setcolor(YELLOW);
circle(325, 300, 2);
delay(5);
}
for(i=400; i>340; i--)
{
cleardevice();
setcolor(RED);
line(319, i, 319, i-120);
line(320, i, 320, i-120);
rectangle(320, i-120, 330,i-100);
setcolor(YELLOW);
circle(325, i-100, 2);
delay(25);
}
cleardevice();
kk=0;
for(j=100; j<350; j++)
{
if (j%20==0)
{
setcolor(kk);
kk=kk+3;
delay(50);
}
ellipse(320, 30, 0, 360, j+100,j+0);
}
for(j=100; j<350; j++)
{
if(j%20==0)
{
setcolor(BLACK);
delay(2);
}
ellipse(320,30,0,360,j+100,j+0);
}
cleardevice();
i=0;
while(!kbhit())
{
color=rand()%15+1;
settextstyle(2,0,6);
setcolor(color+3);
outtextxy(100,(getmaxy()/2)-60,"HAVE A CRACKLING DIWALI, MAY THIS SEASON");
outtextxy(100,(getmaxy()/2)-40,"BRING GOOD LUCK AND HAPPINESS TO YOU.");
settextstyle(3,HORIZ_DIR,5);
setcolor(color+1);
settextstyle(3,0,7);
outtextxy(80,(getmaxy()/5)-50,"HAPPY DIWALI!");
setcolor(color+1);
settextstyle(2,0,7);
outtextxy(150,(getmaxy()/5)-80,"FESTIVAL OF LIGHTS");
x=rand()%1366;
y=rand()%768;
for(i=768;i!=y;i--)
{
if(i%50==0)
delay(1);
putpixel(x,i,14);
}
for(i=768;i!=y;i--)
{
if(i%70==0)
delay(1);
putpixel(x,i,0);
}
for(j=0;j!=100;j+=5)
{
for(i=0;i!=360;i+=15)
{
setcolor(color);
line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));
}
}
setcolor(0);
for(j=0;j!=100;j++)
{
for(i=0;i!=360;i+=15)
line(x,y,x+j*cos(3.14/180*i),y+j*sin(i*3.14/180));
}
}
cleardevice();
getch();
}
0 Comments