Jan 16, 2022

Java Program To Calculate Squire Area - Java Program Example

Write Java Program To  Calculate Square. In This Post We Share A Java Program Code For Calculate Square Entered By User And Show Output On Screen After Compile Program.


package com.androidpro.in;

import
java.io.BufferedReader;
import
java.io.InputStreamReader;
import
java.util.Scanner;

public class
Main {

   
public static void main(String args[])
    {
       
int side, area;
        
Scanner sc = new Scanner(System.in);
       
System.out.println("Enter value of the sides of square");
       
side = sc.nextInt();
       
area = side * side;
       
System.out.println("Area of Square : " + area);
   
}

}

 

Output

Enter value of the sides of square

55

Area of Square : 3025

Process finished with exit code 0

Share:

0 Comments: