Write a program in c plus plus to create an analog and digital clock using computer graphics?

1 answer

Answer

1247971

2026-05-21 16:10

+ Follow

#include "stdio.h"

#include "conio.h"

#include "dos.h"

void main()

{

int h,m,s;

h=0;

m=0;

s=0;

while(1)

{

if(s>59)

{

m=m+1;

s=0;

}

if(m>59)

{

h=h+1;

m=0;

}

if(h>11)

{

h=0;

m=0;

s=0;

}

delay(1000);

s=s+1;

clrscr();

printf("\n DIGITAL CLOCK");

printf("\n HOUR:MINUTE:SECOND");

printf("\n%d:%d:%d",h,m,s);

}

getch();

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.