0

if I enter 55 and 23, it shows correct output as 'Largest number is 55' But if I enter 12 and 3, it shows incorrect output as 'Largest number is 3' (i guess the program is reading only the first letter of the input value)

var read=require("readline-sync")
var a=read.question("Enter 2 Numbers: ")
var b=read.question()
if(a>b){
    console.log("Largest number is "+a)
}else{
    console.log("Largest number is "+b)
}

This is what i'm getting

  • What are you getting? Please include all relevant information in the question, see https://stackoverflow.com/help/how-to-ask – Ingo Steinke Dec 12 '22 at 10:52

0 Answers0