Computer Science, asked by rishabhverma69, 1 year ago

write a java program to input area of square and find its perimeter​

Answers

Answered by AneesKakar
40

Explanation:

import java.util.Scanner;

import java.lang.*

public class JavaProgram

{

   public static void main(String args[])

   {

       int side, perimeter, area;

       Scanner scan = new Scanner(System.in);

 

       System.out.print("Enter Area of Square : ");

       area = scan.nextInt();

       side=Math.sqrt(area)

   

       perimeter = 4*side;

       System.out.print("\nPerimeter of Square is : = " +perimeter);

   }

}

Output:

Enter Area of Square : 36

Perimeter of square  is : 24

Answered by hannierchristina05
8

Answer:

Explanation:

import java.util.*;

class Q1

{

static void main()

{

double a,p,s;

Scanner sc=new Scanner(System.in);

System.out.println(“Enter the area of the square:”);

a=sc.nextDouble();

s=Math.sqrt(a);

p=4*s;

System.out.println(“Perimeter=”+p);

}

}

2. Write a program to input

Similar questions