Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

The art where we need to add if statement

level 8/ lesson 4. I cant understand what to put in if statement
by

1 Answer

sam5epi0l
Here s the if code block:


let result;
if(y!=0) {
result = x / y;
console.log("Result: "+ result);
}
else {
console.log("Cannot divide a number by zero");
}

Login / Signup to Answer the Question.