1. Engineering
  2. Computer Science
  3. a consider the following javascript code segment message ...

Question: a consider the following javascript code segment message ...

Question details

A.   Consider the following JavaScript code segment:

message = '';
if (num1 > num2) {
message = message + 'ONE-';
num1 = num1 - num2;
}
else {
message = message + 'TWO-';
if (num1 * num2 <= 100) {
message = message + 'THREE-';
num1 = num1 / 2;
}
}
message = message + num1;

•   Assuming num1 = 8 and num2 = 8, what is the value of message after executing the above code?

•   Assuming num1 = 12 and num2 = 9, what is the value of message after executing the above code?

•   Assuming num1 = 9 and num2 = 12, what is the value of message after executing the above code?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution