Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Wednesday, 10 January 2018

C program to create a countdown program with graphics

#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 = 60; i >=0; i--) { sprintf(a,"%d",i); outtextxy(getmaxx()/2, getmaxy()/2, a); delay(1000);  if ( i == 0 ) break; cleardevice(); }  getch(); closegraph(); return 0;}

No comments:

Post a Comment