How to calculate a where 3(a + b + c) + a = 20 and a + b + c = 7 in JavaScript

1 Answer

0 votes
const sumAbc = 7; // Represents (a + b + c)
const total = 20;  // Represents 3(a + b + c) + a

// Solve for a: a = 20 - 3 * (a + b + c)
const a = total - 3 * sumAbc;

console.log(`The value of a is: ${a}`);


/*
run:

The value of a is: -1

*/

 



answered 3 days ago by avibootz
...