Mathmatical Expressions Homework
Mathmatical Expressions Homework
// CODE_RUNNER: Mathmatical Expressions Homework
Homework Problem #1. Create a program that check if a number y is divisible by 5 or not, use modulo in this!
let y = 25; // change this number to test
let total = y % 5; // modulo finds the remainder
console.log(y + " % 5 = " + total);
if (y % 5 === 0) {
console.log(y + " is divisible by 5");
} else {
console.log(y + " is not divisible by 5");
}
Homework Problem #2. Create a program that has three variables, a,b,and sum, which adds them together, use console.log to print the final output.
let a = 5;
let b = 3;
let sum = a + b;
console.log("The sum is: " + sum);