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();
}
#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
Post a Comment