Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. process.stdin.resume();
  2. process.stdin.setEncoding('utf8');
  3.  
  4. console.log('What is your age ? ');
  5. process.stdin.on('data', (num) => {
  6. if (num <= 99 && num >0) {
  7. console.log(2019 - num);
  8. process.exit();
  9. } else {
  10. console.log('Not a number or to higth number');
  11. process.exit();
  12. };
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement