Java

Java Program To Input a Number and Display Its Square1 min read

 Write a Java Program To Input a Number and Display Its Square. The sample run of the required Java program is shown in the image below:

For getting input in a Java program, we may use the Scanner class. Please click on the above heading to read the complete input process step by step with images and the sample Java program.

The Source code of Java Program to input a number and calculate its square




Output:

Which of the following code is to read a number and display its square.

More java code examples click here.

Leave a Comment