Commit 0949bffe authored by nittaya chompoosan's avatar nittaya chompoosan

ขอ 2 คะแนน

parent 2c5cf4a3
const rl = require('readline')
const r = rl.createInterface({
input: process.stdin,
output: process.stdout
});
let i = 0
console.log('คุณชื่ออะไร:')
r.on('line',(line) =>{
if(i==0){
console.log('เบอร์โทร:')
name = line
i++
}
else if (i==1){
console.log('ปีเกิด พ.ศ.:')
phone = line
i++
}
else if (i==2){
console.log(`สวัสดีคุณ : ${name} เบอร์ : ${phone} อายุ : ${2560-line}`);
r.close();
}
})
{
"name": "week03",
"version": "1.0.0",
"description": "การบ้านสัปดาห์ที่ 3",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"homework",
"03"
],
"author": "nittaya",
"license": "ISC"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment