JavaScript program to check if two numbers have the same last digit:

Created with Sketch.

JavaScript program to check if two numbers have the same last digit:

let firstNumber = parseInt(prompt("Enter the first number:"));
let secondNumber = parseInt(prompt("Enter the second number:"));

if (firstNumber % 10 === secondNumber % 10) {
  console.log("The numbers have the same last digit.");
} else {
  console.log("The numbers do not have the same last digit.");
}

Leave a Reply

Your email address will not be published. Required fields are marked *