Filter löschen
Filter löschen

Script that returns the square of a prompted number

2 Ansichten (letzte 30 Tage)
Itzel
Itzel am 4 Okt. 2023
Kommentiert: James Tursa am 4 Okt. 2023
Write a script that will prompt the user for a number, and will print the square of the user’s number in the following format:
Enter a number: 11.1
Your number squared is 123.21
I know how to write the part of the script that prompts the user for a number, but I was wondering how to get it to print the square of whatever number the user gives. I am not looking for the entire code, I would just like an explanation on how to get it to print the square of the number one gives.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Okt. 2023
Verschoben: Adam Danz am 4 Okt. 2023

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by