Write a c program to change the background(setbkcolor()) of the screen

//Write a c program to change the background(setbkcolor()) of the screen 

#include<conio.h>
#include<stdio.h>
#include<graphics.h>

void main()
{
  int gd=DETECT,gm;
  int ch;

  printf("Choose your color \n1. RED \n2.BLUE\n3. GREEN ");
  scanf("%d",&ch);
  initgraph(&gd,&gm,"c://Turboc3//bgi");
  switch(ch)
  { case 2:
    setbkcolor(BLUE);
    break;
    case 3:
    setbkcolor(GREEN);
    break;
    case 1:
    setbkcolor(RED);
    break;
    default: printf("Wrong choice");
  }
 
  getch();
  closegraph();


}

Comments

Popular posts from this blog

1000 Phrases and Sentences to improve English speaking especially for Group Discussion and personal interview