C program countdown
This c graphics program performs countdown for 30 seconds.
C program countdown code
[ad type=”banner”]
This c graphics program performs countdown for 30 seconds.
#include <graphics.h>
#include <dos.h>
#include <conio.h>
int main()
{
int gd = DETECT, gm, i;
char a[5];
initgraph( &gd, &gm, "C:\\TC\\BGI");
settextjustify( CENTER_TEXT, CENTER_TEXT );
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
setcolor(RED);
for (i = 30; i >=0; i--)
{
sprintf(a,"%d",i);
outtextxy(getmaxx()/2, getmaxy()/2, a);
delay(1000);
if ( i == 0 )
break;
cleardevice();
}
getch();
closegraph();
return 0;
}
Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.
Our site uses cookies. By using this site, you agree to the Privacy Policy and Terms of Use.