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
You must be signed in to leave a comment
16 September 2021, 00:50
see Jack approach below -- look carefully
4 August 2021, 09:06
ah crap, forgot to leave spaces between factors, useful exercise.
9 March 2021, 23:11
oh, i thought the output would be 25.. i got it anyway at two attempts
25 March 2020, 22:23
I got the same output result a different way...
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
13 July 2020, 18:34
yes but it does not work for all the possible inputs
21 February 2020, 23:36
My Bad I did not see that the class had already declared the variable number.
21 February 2020, 23:35
Did not see where it introduced using public static int declaration
6 October 2019, 02:37
Forgot printing integers does not require quotation marks.
19 August 2019, 08:47
9 July 2019, 10:42