Computer Science, asked by srivastavavinay03, 9 months ago

Write a program in Java to assign radius of value.find and print area of circle using the formula area = pi*r2

Answers

Answered by ghorai55
7

Answer:

import java.util.Scanner;

public class Area

{

public static void main(String[] args)

{

int r;

double pi = 3.14, area;

Scanner s = new Scanner(System.in);

System.out.print("Enter radius of circle:");

r = s.nextInt();

area = pi * r * r;

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

}

}

Output:

$ javac Area.java

$ java Area

Similar questions