+ 1
Can you fix it?
var num1 = prompt("Please enter the first number"); var num2 = prompt("please enter the second number"); if (num1 >= num2) { alert("First Number is greater than Second Number"); } else if (num1 <= num2 ){ alert ("Second Number is greater than First Number"); } else { alert ("they are equal") ; }
3 odpowiedzi
+ 3
Doniyorbek Urinboyev wow thanks !
+ 1
First, in your case, where you want to alert if num1 & num2 are equals, use the < or > operators, instead of <= and >=.
Then, do you get any errors ?
+ 1
Choubada its ok now.