//Downloaded From theonlinetutorials.com
#include "stdio.h"
#include "conio.h"
#include "dos.h"
int main()
{
int i,flag=0;
char s[100];
clrscr();
for(i=30;i>=0;i--)
{
if(kbhit())
{
scanf("%s",s);//User want to take input
flag=1;//Call the operation you require
break;//Terminate the loop
}
delay(1000);
printf("\n00:%2d",i);
}
if(flag==1)
printf("User entered %s",s);//If user entered a value display it
getch();
return 0;
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program – Timer program
- C program to check whether a given number is prime or not and output the given number with suitable message
- C program to generate and print prime numbers in a given range. Also print the number of prime numbers
- C program to evaluate the given polynomial P(x)=AnXn + An-1Xn-1 + An-2Xn-2+… +A1X + A0, by reading its coefficients into an array. [Hint:Rewrite the polynomial as P(x) = a0 + x(a1+x(a2+x(a3+x(a4+x(...x(an-1+xan)))) and evaluate the function starting from the inner loop]
- C Program to accept two matrices and check if they are equal
