find square of a number in java using assignment statement
Answers
Answered by
1
Explanation:
// Java Program to Find Square of a Number
import java.util.Scanner;
public class SquareofNumber {
private static Scanner sc;
public static void main(String[] args)
{
int number, square;
sc = new Scanner(System.in);
System.out.print(" Please Enter any Number : ");
number = sc.nextInt();
square = number * number;
System.out.println("\n The Square of a Given Number " + number + " = " + square);
}
}
Attachments:
Similar questions