Write a JavaScript program to compute the absolute difference between a specified number and 19. Returns triple their absolute difference if the specified number is greater than 19.
function diff_num(n) {
if (n <= 19) {
return (19 - n);
}
else
{
return (n - 19) * 3;
}
}
console.log(diff_num(12));
console.log(diff_num(19));
console.log(diff_num(22));
function diff_num(n) {
if (n <= 19) {
return (19 - n);
}
else
{
return (n - 19) * 3;
}
}
console.log(diff_num(12));
console.log(diff_num(19));
console.log(diff_num(22));
I've completed 70K Followers on my Instagram page @coding_.master 🥳🥳😍😍😍🔥🔥
Thnxx to all guys from the bottom of my heart ❤❤❤🥰🥰🤗🤗
Keep supporting always 😍😍
Follow us on Instagram to learn web development 👉👉 https://www.instagram.com/coding_.master/
Thnxx to all guys from the bottom of my heart ❤❤❤🥰🥰🤗🤗
Keep supporting always 😍😍
Follow us on Instagram to learn web development 👉👉 https://www.instagram.com/coding_.master/