Question: let input = window.prompt ( Enter a number: ) ; let number = parseFloat ( input ) ; if ( number = = =

let input = window.prompt("Enter a number:");
let number = parseFloat(input);
if (number ==="5"){
window.alert("That's not a valid number!");
} else {
window.alert("The square of your number is: "+ number * number);
}
Assuming the user enters 5, what will be the output of the code above?
Error
The square of your number is: 25
The square of your number is: 5
That's not a valid number!
The square of your number is: 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!