Computer Science, asked by adfrt, 11 months ago

Write a program to enter the perimeter of a circle and find its radius and area

Answers

Answered by Anonymous
5

import java.util.*;

public class Radius_Area

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

float p,r,a;

System.out.println("Enter the perimeter");

p=in.nextFloat();

r=p*(7/22)*(1/2);

a=(22/7)*r*r;

System.out.println("The radius is"+r);

System.out.println("The area is"+a);

}

}

Answered by Anonymous
0

import java.util.*;

public class Radius_Area

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

float p,r,a;

System.out.println("Enter the perimeter");

p=in.nextFloat();

r=p*(7/22)*(1/2);

a=(22/7)*r*r;

System.out.println("The radius is"+r);

System.out.println("The area is"+a);

}

}

Similar questions