Computer Science, asked by shivani99719650, 11 months ago

java program to calculate the area of circle​

Answers

Answered by 007Boy
7

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

Enter radius of circle:5

Area of circle:78.5

Answered by eashgupta644
1

class area

{

Void input(int x)

{

int area=x×22/7;

System.out.print(area);

}

}

Similar questions