Computer Science, asked by tryptophan, 1 year ago

3. Write a program to calculate the area of square in JAVA

Answers

Answered by kapil19jun01
1

Answer:

/**

* @author: BeginnersBook.com

* @description: Program to Calculate Area of square.Program

* will prompt user for entering the side of the square.

*/

import java.util.Scanner;

class SquareAreaDemo {

public static void main (String[] args)

{

System.out.println("Enter Side of Square:");

//Capture the user's input

Scanner scanner = new Scanner(System.in);

//Storing the captured value in a variable

double side = scanner.nextDouble();

//Area of Square = side*side

double area = side*side;

System.out.println("Area of Square is: "+area);

}

}

I hope it's helpful 4 u

mark on brilliant

Answered by anurag7658
0

Answer:

zcnsgjnxvnzvjdgnzvnsgn

Explanation:

nsgnsgjtwsgidgns

Similar questions