-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.cpp
43 lines (35 loc) · 883 Bytes
/
colors.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
int main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm," ");
outtextxy(300,10,"Colors");
outtextxy(540,450,"Press e to exit");
rectangle(100,100,150,150);
setfillstyle(1,RED);
floodfill(140,130,WHITE);
outtextxy(100,160,"Red");
rectangle(200,100,250,150);
setfillstyle(1,CYAN);
floodfill(220,120,WHITE);
outtextxy(200,160,"Cyan");
rectangle(300,100,350,150);
setfillstyle(1,WHITE);
floodfill(320,120,WHITE);
outtextxy(300,160,"White");
rectangle(400,100,450,150);
setfillstyle(1,BLUE);
floodfill(420,120,WHITE);
outtextxy(400,160,"Blue");
rectangle(500,100,550,150);
setfillstyle(1,GREEN);
floodfill(520,120,WHITE);
outtextxy(500,160,"Green");
if(getch()=='c'){
exit(1);
}
closegraph();
}