18.4k views
1 vote
1. Write the console log statement missing from line 7 that is needed to display the final value of each variable 2. Trace the code, and state what will be displayed in the console. 1. Var a=5; 2. Var b=2; 3. Var c=7; 4. A=a+b; 5. B=a+b; 6. C=a+b; 7.________

User Alchuang
by
5.4k points

1 Answer

0 votes

Answer:

  1. var a = 5;
  2. var b = 2;
  3. var c = 7;
  4. a = a + b;
  5. b = a + b;
  6. c = a + b;
  7. console.log(a);
  8. console.log(b);
  9. console.log(c);

Step-by-step explanation:

Line 7 - 9

Use console.log to display variable a, b and c to terminal and we will get the result as below

7

9

16

The a is 7 because a = a + b = 5 + 2 = 7

The b is 9 because b = a + b = 7 + 2 = 9

The c is 16 because c = a + b = 7 + 9 = 16

User Alain Boudard
by
4.2k points