Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Sep 23rd, 2018 57 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('How old are you ? ')
  5. process.stdin.on('data', (age) => {
  6.  
  7.   if(isNaN(age)) {
  8.     console.log('Please enter a age')}
  9.  
  10.   else if(age > 99) {
  11.     console.log('Please enter a maximum age of 99')}
  12.  
  13.   else if(age === 0) {
  14.     console.log('You were born on 2017')}
  15.    
  16.   else {
  17.     console.log('You were born on ' + (2018-age))
  18.     process.exit()
  19.   }
  20. })
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
 
Top