Q:

Java Program to find area of a square

0

Program to find area of a square by using scanner to get the user's input.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.util.Scanner;
class demo1 {
   public static void main (String[] args)
   {
       System.out.println("Enter Side of Square:");
       Scanner input = new Scanner(System.in);
       double side = input.nextDouble();
       double area = side*side; 
       System.out.println("Area of Square is: "+area);
   }
}  

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now