Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.stdin.resume()
- process.stdin.setEncoding('utf8')
- console.log('What is your age ?')
- process.stdin.on('data', function( age ) {
- if ( ( age < 99 ) && ( age > 0) ) {
- console.log( 'Congratulation ! You are born in:' + ( 2019 - age ) )
- } else if ( age > 99 ) {
- console.log( 'Sorry, you are probably die if not please contact support ;)' )
- } else {
- console.log( 'Try Again' )
- process.exit()
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement