Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.stdin.resume()
- process.stdin.setEncoding('utf8')
- console.log('What\'s your age ? ')
- process.stdin.on('data', function(age) {
- if (isNaN(age)) {
- console.log ('Not a Number!')
- }else{
- if( (age > 0) && (age < 99) ){
- console.log('Your year of birth is ' + (2019 - age) )
- } else {
- console.log('Try again')
- }}
- process.exit()
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement