a Java program to generate the area of circle
Answers
Answered by
4
Heya.....❤️❤️
★ ★ ★ ★ ★ ★ ★ ★
class AreaofCircle{
public static void main()
{
{
int r = 7;
int Area = 22/7 * 7 * 7;
System.out.println("Area of circle = " + Area);
}
}
}
Output
Area of circle = 154
____________________________________________________________________________________
Java is a predifined computer specialized coding.
Java follows some rules in the programs.
★ ★ ★ ★ ★ ★ ★ ★
class AreaofCircle{
public static void main()
{
{
int r = 7;
int Area = 22/7 * 7 * 7;
System.out.println("Area of circle = " + Area);
}
}
}
Output
Area of circle = 154
____________________________________________________________________________________
Java is a predifined computer specialized coding.
Java follows some rules in the programs.
newyork05ananya:
This program is totally wrong. I am a beginner to java and i have done it.
Answered by
5
CODE
import java.util.*;
class area
{
public static void main ( String args [] )
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the radius");
int r=sc.nextInt();
double pi=3.14;
double area = pi*r*r;
System.out.println("Area of circle ="+area);
}
}
}
The program first takes the radius as input.
Then we print the area using the formula of circle.
Similar questions