Write a program-timer, that will take the count of seconds as input and output to the console all the seconds until timer stops? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 2

Write a program-timer, that will take the count of seconds as input and output to the console all the seconds until timer stops?

code I used- function main(){ var seconds=parseInt(readline(),10) var i=0; while(i<=10){ console.log(i) i=seconds-1; } }

7th Apr 2021, 6:15 AM
Chandan Chhetry
Chandan Chhetry - avatar
3 ответов
+ 4
function main() { var seconds = parseInt(readLine(), 10) while(seconds>=0){ console.log(seconds) seconds-- } }
22nd Jun 2022, 6:55 PM
Tharushi Salgado
Tharushi Salgado - avatar
0
//try this while(seconds>=i){ console.log(seconds) seconds-- }
7th Apr 2021, 6:37 AM
Simba
Simba - avatar
0
var i=seconds; for(;i>=0;i--) { console.log(i); }
29th Aug 2022, 8:50 PM
Poongothai Rajesh