-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.c
More file actions
38 lines (28 loc) · 720 Bytes
/
10.c
File metadata and controls
38 lines (28 loc) · 720 Bytes
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
//10. WAP to draw a Pie Chart.
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
void main()
{
int gd = DETECT , gm , x ,y;
initgraph(&gd,&gm,"C:\turboc3\bgi");
settextstyle(BOLD_FONT,HORIZ_DIR,2);
outtextxy(220,10,"PIE CHART");
x=getmaxx()/2;
y=getmaxy()/2;
settextstyle(SANS_SERIF_FONT,HORIZ_DIR,1);
setfillstyle(SOLID_FILL,RED);
pieslice(x,y,0,60,120);
outtextxy(x+140,y-70,"FOOD");
setfillstyle(SOLID_FILL,YELLOW);
pieslice(x,y,60,160,120);
outtextxy(x-30,y-170,"RENT");
setfillstyle(SOLID_FILL,GREEN);
pieslice(x,y,160,220,120);
outtextxy(x-250,y,"ELECTRICITY");
setfillstyle(SOLID_FILL,BROWN);
pieslice(x,y,220,360,120);
outtextxy(x,y+150,"SAVINGS");
getch();
closegraph();
}