+ 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") ; }

1st Aug 2018, 9:55 PM
Armann
Armann - avatar
3 odpowiedzi
+ 3
1st Aug 2018, 10:01 PM
Armann
Armann - avatar
+ 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 ?
1st Aug 2018, 10:02 PM
Chalza
Chalza - avatar
+ 1
Choubada its ok now.
1st Aug 2018, 10:03 PM
Armann
Armann - avatar