Code 2

Code 2






Code 2
/*www.mycfiles.com*/
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <graphics.h>
#include<stdlib.h>
#include<dos.h>
void main()
{
int dr,md,midx,i, midy,mx, my,x,y,fact;
double pi,tpi,a,t,r;
dr = DETECT;
fact=220;

initgraph(&dr, &md, "c:\\tc\\bgi");
midx = getmaxx()/2; midy = getmaxy()/2;
pi = 3.14159;
tpi = pi * 2.0;

for (a=0.0; a<tpi; a=a+pi/180)
{
r = fact * (cos(a) * sin(10+a));
x = midx + r * cos(a);
y = midy + r * sin(a);
putpixel(x,y,random(getmaxcolor()));
getch();

}



getch();
}




0 comments:

Post a Comment

 
Twitter Bird Gadget