Monday 27 October 2014

Rainbow

Animated Rainbow:

Hey friend here is one of the easiest code for an animated rainbow:

Code:
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd = DETECT,gm;
int x,y,i;
initgraph(&gd,&gm,"C:\\Turboc3\\BGI");
x=getmaxx()/2;
y=getmaxy()/2;
for(i=30;i<200;i++)
{
delay(100);
setcolor(i/10);
arc(x,y,0,180,i-10);
}
getch();
}

Output:

No comments:

Post a Comment