First impressions are rarely the best, but they are certainly what we remember for the rest of our lives. We're talking about programming, in case you were wondering. In this task, we will try to calculate the square of a number, display it on the screen, and also use the ability to read data from the keyboard (the user will enter the number while the program is running).
Display the square of a number
- 2
Locked
Comments (50)
- Popular
- New
- Old
You must be signed in to leave a comment
Thomas
16 September 2021, 00:50
see Jack approach below -- look carefully
0
David Cáceres
4 August 2021, 09:06
ah crap, forgot to leave spaces between factors, useful exercise.
0
Grace
9 March 2021, 23:11
oh, i thought the output would be 25.. i got it anyway at two attempts
+1
Brendon Martell
25 March 2020, 22:23
I got the same output result a different way...
+1
Edip Uslu
22 February 2020, 10:27
what if i use *25 rather then number again ?Isnt it another approach to the answer whith the same result
+2
Sean Nigito
13 July 2020, 18:34
yes but it does not work for all the possible inputs
+2
Robert Tonkavich
21 February 2020, 23:36
My Bad I did not see that the class had already declared the variable number.
+1
Robert Tonkavich
21 February 2020, 23:35
Did not see where it introduced using public static int declaration
0
Timothy Strong
6 October 2019, 02:37
Forgot printing integers does not require quotation marks.
+1
hidden #10410956
19 August 2019, 08:47
nice
+2
Sam Idris
9 July 2019, 10:42
wow
+1