Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. const actualYear = 2019;
  5.  
  6. console.log('What\'s your age ? ')
  7.  
  8.  
  9. process.stdin.on('data', (yearOld) => {
  10. if (yearOld<99){
  11. console.log(2019-yearOld)
  12. } else {
  13. console.log("You are nearly dead or you wrote text idiot")
  14. }
  15. process.exit()
  16. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement