Background color in turbo C

Here a Graphics program for you like Background color in turbo C.

How to color the output of a program in C

#include<stdio.h>

#include<graphics.h>
#include<conio.h>
main()
{
int gd = DETECT, gm, drawing_color,x,y,s;

initgraph(&gd,&gm,“C:\\TC\\BGI“);

setbkcolor(2);
printf(“\n Enter first Number:-“);
scanf(“%d”,&x);
printf(“\n Enter second Number:-“);
scanf(“%d”,&y);
s=x+y;
printf(“\n Sum of two number is:-%d,s);

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

Graphics program in C with output

 

Background color in turbo C
Background color in turbo C

 

Leave a Reply

x