Loading progress bar program in C

Here is the progress bar program in c which shows loading screen while the program is running. This program is just to show how you can show a progress bar in c programming, You might have to do functional changes based on your need.

Before you copy and start execution of the program, I would suggest completing the instructions mentioned in the article.

- circle(x, y, radius)  :- Circle function is used to draw a circle with center (x,y)
void pieslice(int x, int y, int s_angle, int e_angle, int r) :- Draws and fills a pie slice with center at (x, y) and given radius r.
- void outtextxy(int x, int y, char *string) :- Displays the text or string at a specified point (x, y) on the screen.
- void delay(unsigned int): delay function is used to suspend execution of a program for a particular time.
#include<graphics.h>
#include<dos.h>

void main()
{
int gd=DETECT,gm,i;
initgraph(&gd,&gm,”c://TC//BGI”);
for(i=0;i<=360;++i)
{
circle(300,200,80);
pieslice(300,200,0,i,80);
outtextxy(200,320,”Loading….Please Wait!”);
delay(20);
}
closegraph();
}
Output:
Progress Bar Program in C - Output
Progress Bar Program in C - Output

Post a Comment

0 Comments