Write a program which will ask the user to entertime in seconds (integer input)
ID: 3608354 • Letter: W
Question
Write a program which will ask the user to entertime in seconds (integer input) and print the
text(“Assignment is very easy”).
A): Print this statement till the time (seconds)entered by user.
(Hint: This time willbe real time. Above statement will get printed till enteredtime)
B): Along with each print statement also print the“remaining time”.
C): After printing above two (Statement and remainingtime). It should prompt for any key to be
pressed while the timebehind will kept running.
Output:
Please enter time insecond: 11 (For example)
Assignment is veryeasy the remaining time is 11 Press any key
Assignment is veryeasy the remaining time is 7 Press any key
Assignment is veryeasy the remaining time is 6 Press any key
Assignment is veryeasy the remaining time is 4 Press any key
Assignment is veryeasy the remaining time is 3 Press any key
Assignment is very easy theremaining time is 0 Press any key
Explanation / Answer
//Hope this will help you.. #include #include using namespace std; int main() { time_t t1,t2; int t,rt; coutt; t1=time(NULL); while(1) { t2=time(NULL); rt=-t2+t1 + t; if(rtRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.