Skip to content

Instantly share code, notes, and snippets.

@w3Abhishek
Created July 31, 2021 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w3Abhishek/662d5a4e1d0b9d88a945dfad0467dc7a to your computer and use it in GitHub Desktop.
Save w3Abhishek/662d5a4e1d0b9d88a945dfad0467dc7a to your computer and use it in GitHub Desktop.
#include<graphics.h>
#include<conio.h>
int main() {
int gd = DETECT, gm, x, y;
initgraph(&gd, &gm, "C:\\TC\\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();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment