Computer Science, asked by bondbaking74, 14 hours ago


write a java program to find the area of square
by using input stream
use the method of input stream​

Answers

Answered by nskruthik
1

Answer:

Square is a parallelogram with four sides of equal length and with all right angles (90)

Following image shows you how a Square looks like

info-about-image

Following is the Java program that takes Length, Breadth as inputs and compute Area, Perimeter & Length of diagonal of a Square

import java.util.Scanner;

public class AreaAndPerimeterOfSquare {

public static void main(String[] args) {

// Taking inputs from user

Scanner sc = new Scanner(System.in);

System.out.print("Enter the Length: ");

double length = sc.nextDouble();

sc.close();

double area = length * length;

double perimeter = 4 * length;

double diagonal = Math.sqrt(2) * length;

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

System.out.println("Perimeter: " + perimeter);

System.out.println("Length of diagonal: "

Answered by gsysdgesport
0

Answer:

TUMKO NHI ATA PADHAI KATO

Explanation:

MOM SE SIKAYAT KARUNGA TUMHARI

Similar questions