write a program to assign radius of a Circle and
find its area of a circle?
Answers
Answered by
0
Area of a circle program in C
1. int main() { float radius, area;
2. printf("Enter the radius of a circle\n");
3. scanf("%f", &radius);
4. area = 3.14159*radius*radius;
5. printf("Area of the circle = %.2f\n", area); // printing upto two decimal places.
6. return 0; }
Answered by
0
Java program.
Import java.util.*;
Class cls
{
Public static void main();
{
Scanner sc = new Scanner(System.in);
System.out.println(“Enter the Radius of the circle”);
Double a = sc.nextDouble();
Double b = (22/7)*a*a;
System.out.println(“area :” +b);
}
}
Import java.util.*;
Class cls
{
Public static void main();
{
Scanner sc = new Scanner(System.in);
System.out.println(“Enter the Radius of the circle”);
Double a = sc.nextDouble();
Double b = (22/7)*a*a;
System.out.println(“area :” +b);
}
}
Similar questions