Rainbow Animation With C/C++

 Hello friends welcome to our new fresh blog. This blog contains the source code of Rainbow Animation With C/C++ you can simply copy this code and run it. You can run this code in .c and .cpp extention 



           


--SOURCE CODE--

#include<graphics.h>
int main()
{
initwindow(800,500,"RAINBOW",150,50);
for(int i=1;i<180;i++)
{
for(int j=1;j<=48;j++)
{
setcolor(LIGHTMAGENTA);
arc(400,450,0,1+i,50+j);
setcolor(LIGHTCYAN);
arc(400,450,0,1+i,100+j);
setcolor(LIGHTGRAY);
arc(400,450,0,1+i,150+j);
setcolor(LIGHTGREEN);
arc(400,450,0,1+i,200+j);
setcolor(LIGHTBLUE);
arc(400,450,0,1+i,250+j);
setcolor(YELLOW);
arc(400,450,0,1+i,300+j);
setcolor(LIGHTRED);
arc(400,450,0,1+i,350+j);
    }
delay(10);
}
getch();
closegraph();
}

 

if you are getting errors then you haven't include graphics.h header in your compiler so you must add this header file because all funtions are declared in this header. You can read our blog How To Run Graphics Program or you can watch Video .



Post a Comment

Previous Post Next Post