a Java program to generate the area of circle
Answers
Answered by
3
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.
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.
Answered by
0
hi
hope it helps to you
. Static Method
import java.util.Scanner;
class AreaOfCircle
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the radius:");
double r= s.nextDouble();
double area=(22*r*r)/7 ;
System.out.println("Area of Circle is: " + area);
}
}
Output:
Enter the radius :
7
Area of circle : 154.0
thanks
hope it helps to you
. Static Method
import java.util.Scanner;
class AreaOfCircle
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the radius:");
double r= s.nextDouble();
double area=(22*r*r)/7 ;
System.out.println("Area of Circle is: " + area);
}
}
Output:
Enter the radius :
7
Area of circle : 154.0
thanks
Similar questions