Loading...
Run
Clear
Enter Debug Mode
Run
20ms
50ms
100ms
200ms
500ms
Step
Exit
let a = inputNumber("Please input a", 0); let sum = 0; let prod = 1; function isEven(x) { let h = x / 2; let ih = Math.floor(h); if (h === ih){ return true; } return false; } for(let i = 1; i <= a; i++) { sum = sum + i; prod = prod * i; if (isEven(sum)) { print("Even sum", sum); } else { print("Odd sum", sum); } print("Product", prod); } print("Final sum", sum); print("Final product", prod);
Current variable values
Variable Name
Value
Last executed code:
(Not executed yet)