Sunday 1 July 2012

program to draw a waves in c++.

#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
void main()
{
int gd,gm,mx,my,i,m,n,k,p;
m=50;
n=10;
p=0;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"");
mx=getmaxx()/2;
my=getmaxy()/2;
setcolor(BLACK);
for(k=0;k<49;k++)
{
setfillstyle(SOLID_FILL,BLACK);
pieslice(mx,p,0,360,5);
p=p+5;
delay(50);
clrscr();
}

for(i=0;i<18;i++)
{
setcolor(BLUE);
ellipse(mx,my,0,360,m,n);
m=m+15;
n=n+7;
delay(100);
}
getch();
clrscr();
int a,b;
for(a=240,b=100;a<=260,b<=120;a++,b++)
{
setcolor(BLUE);
rectangle(mx-a,my-b,mx+a,my+b);
delay(35);
}
settextstyle(TRIPLEX_FONT,0,15);
outtextxy(mx-210,my-90,"");
getch();
}


No comments:

Post a Comment