Write a JavaScript program to compute the sum of the two given integers. If the two values are same, then returns triple their sum
- برمجة جافاسكربت java script
- 2021-06-01
- ahmadghneem
الأجوبة
function sumTriple (x, y) {
if (x == y) {
return 3 * (x + y);
}
else
{
return (x + y);
}
}
console.log(sumTriple(10, 20));
console.log(sumTriple(10, 10));
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال