Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('How old are you ? ')
  5. process.stdin.on('data', (age) => {
  6. if (typeof(age) == 'number'){
  7. if (age>0 && age<99) {
  8. if ((2019-age)<2019){
  9. return (2019 - age);
  10. }
  11. }
  12. }
  13. console.log('You are born in ' + (2019-age))
  14. process.exit()
  15. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement