How To Draw a Spiral Animation in C (Computer Graphics)
PROJECT BY (SIMPLIFY LEARN PROGRAMMING)
ON
SPIRAL ANIMATION
Source Code:
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
void main()
{
float i=0.1;
int j=0,gd=DETECT,gm,x,y;
initgraph(&gd,&gm,"C:\\TC\\BGI");
x=getmaxx()/2;
y=getmaxy()/2;
while(!kbhit())
{
setcolor(rand()%16)
arc(x,y,1+j,2+j,i+=0.1);
delay(10);
j++;
}
getch();
closegraph();
}
Output:
Comments
Post a Comment