Q:

getbkcolor function in C using graphics.h

0

getbkcolor function in C using graphics.h

Function getbkcolor returns the current background-color.

Declaration: int getbkcolor();

e.g. color = getbkcolor(); // color is an int variable
If current background color is GREEN, color will be 2.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <graphics.h>
#include <conio.h>
int main()
{
   int gd = DETECT, gm, bkcolor;
   char a[100];

   initgraph(&gd,&gm,"C:\\TC\\BGI");
   
   bkcolor = getbkcolor();

   sprintf(a, "Current background color = %d", bkcolor);
   outtextxy(10, 10, a);

   getch();
   closegraph();
   return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now