Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.stdin.resume()
- process.stdin.setEncoding('utf8')
- console.log('How old are you ? ')
- process.stdin.on('data', (check) => {
- if ((isNaN(check)) || (check > 99 )) {
- console.log('please enter a number under 99');
- }
- else {
- console.log("You were born in " + (2019 - check));
- process.exit();
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement