You are doomed.

Level 1

Despite the slim chances of living, you have survived this far. However, now, you are forced to help me. I heard that you were a famous programmer and I will need your advice. If you give me the wrong answer you will perish, else, I will let you live to see another day. Which of the following describes what happens when the following code is executed in Javascript:

for(i = 1; i < 100; i++){
if(i%3 === 0){
console.log(i);
}
}
Nothing Outputs all numbers that are not multiples of 3 smaller than 100 Outputs 3 Output all multiples of 3 smaller than 100

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Christian Zinck
Jan 8, 2015

It is a for loop for values "i" less than 100. If i = 0 mod(3), meaning if i is divisible by 3, then the program will output the value of i that satisfies the condition. Therefore, all multiples of 3 less than 100 will be displayed.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...