Generate Randomly Change color in Cpp Programming with Computer Graphics.
Code

# include <graphics.h>
# include <conio.h>
# include <iostream.h>
void get_driver()
{
    int gDriver=DETECT,gMode;  // define variables
    initgraph(&gDriver,&gMode,"c:\\tc\\bgi"); // initialize graphics Library
}
void main()
{
get_driver(); // To make function of define drivers</span>
maxcolor=getmaxcolor();
for(i=0;i<maxcolor;i++)
{
setbkcolor(i);
delay(500);
}
getch();
}

OUTPUT

 

(Visited 1,307 times, 1 visits today)
Share with Friends :
Written by:

Leave a Reply

Your email address will not be published. Required fields are marked *