Program for 1-40 counting with the delay of 1 second

Asked By 30 points N/A Posted on -
qa-featured

Write the C program that should print 1-40 counting with the delay of 1second by using the timer count value from the BIOS data area.

SHARE
Best Answer by James20
Best Answer
Best Answer
Answered By 5 points N/A #95769

Program for 1-40 counting with the delay of 1 second

qa-featured

I wrote the following piece of code for you; please check it:

#include<stdio.h>
#include<conio.h>

unsigned long int far *time = (unsigned long int far*) 0x0040006C;
void main()
{
unsigned long int tx,count=0;
tx = (*time);

while( count<=40)
{

while((*time) <= tx);
clrscr();
printf("%d Secdonds       ",count);

tx+=18;
count++;

}

//getch();

}

Related Questions