SHARE
TWEET

Untitled

a guest Oct 19th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('What is your age ?')
  5. process.stdin.on('data', function( age ) {
  6.  
  7.   if ( ( age < 99 ) && ( age > 0) ) {
  8.     console.log( 'Congratulation ! You are born in:' + ( 2019 - age ) )
  9.  
  10.   } else if ( age > 99 ) {
  11.   console.log( 'Sorry, you are probably die if not please contact support ;)' )
  12.  
  13.   } else {
  14.       console.log( 'Try Again' )
  15.       process.exit()
  16.   }
  17. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top