DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Conditionals — Example 63

Quick explanation + ready code for: Conditionals.

Small Basic Conditionals Back to examples
Back to language
Syntax: Conditionals in Small Basic. ID: #63

Code

const n=10;
if(n%2===0) console.log("even"); else console.log("odd");

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.