Question: Write a script that: ( 1 ) uses the input ( ) function to prompt the user to enter a number; ( 2 ) then

Write a script that: (1) uses the input() function to prompt the user to enter a number; (2)
then calculates the square of the user input; and (3) uses the fprintf() function to print out the results
using 2 decimal places. For example, your script shall work exactly like this:
Please enter a number: 6.5
The square of 6.50 is 42.25.

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!