in small basic write a program that inputs the radius of a circle and displays its area and circumference with proper messages.
note: for the value of PI, use Math.PI()
Answers
Answered by
0
Answer:
import java.lang.*;
import java.util.*;
class HelloWorld {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter radius:");
double rad = sc.nextDouble();
double area = Math.PI*rad*rad;
double cir = 2*Math.PI*rad;
System.out.println("Area of the circle is " + area + " and the circumfrence of the circle is " + cir);
}
}
Explanation:
Similar questions
History,
2 days ago
English,
2 days ago
Computer Science,
4 days ago
English,
9 months ago
Biology,
9 months ago