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,363 times, 1 visits today)
Written by: