Write a program to input the radius of a circle and find its area and circumference. Note:
Area of a circle=22/7 * radius^2
Circumference of a circle= 2 * 22/7 * radius
Class 9 - Computer Applications - Ch 5 - Input in JAVA
Answers
Answered by
28
Hey there!
Program to input the radius of a circle and find its area and circumference.
import java.util.*;
public class Question7
{ static void main()
{
Scanner sc=new Scanner(System.in);
float radius,area,circumference;
System.out.println("Enter radius of a circle:");
radius=sc.nextFloat();
area=(float)22/7*radius*radius;
circumference=2*(float)22/7*radius;
System.out.println("Area="+area);
System.out.println("Circumference="+circumference);
}
}
Hope It Helps You!
Answered by
11
hey mate here is ur answer..
import java. util. *;
class circle
{
public static void main ()
{
int r, a, c;
System. out.println( "enter a radius");
r=sc.nextInt();
{
;
;
}
System.out.println("area of circle ");
}
System. out. println( "circumference of circle ");
}
.
.
.
hope this helps you...
import java. util. *;
class circle
{
public static void main ()
{
int r, a, c;
System. out.println( "enter a radius");
r=sc.nextInt();
{
;
;
}
System.out.println("area of circle ");
}
System. out. println( "circumference of circle ");
}
.
.
.
hope this helps you...
duragpalsingh:
There are syntax errors in your program.
Similar questions