Question: Using c, Please hurry I need help please. create a countdown timer that allows the timer to be updated before reaching 0 by using threads.

Using c,

Please hurry I need help please.

create a countdown timer that allows the timer to be updated before reaching 0 by using threads.

When the timer reaches 0 then the timer will terminate.

Here is a code, modify the program so that it can update the timer when for example user input 90 and the timer will reset to 90 and countdown by 1 seconds each time. Please add threads to this program.

Use sleep to make the timer wait 1 sec

The initial value of timer will start at 80

Use main thread so that it will display the count

Use subthreads to read when there is keyboard entry.

#include #include int main() { int time = 99;

do { printf(" %d seconds left",time); time--; sleep(1); fflush(stdout); } while(time>0);

printf(" Terminating because timer reaches 0 "); return(0); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!