Math, asked by pihu535, 11 months ago

Write aprogram that reads in the radious of a circle and then computes its area

Answers

Answered by rishika79
0

Answer:

Step-by-step explanation:

This is a Java Program to Calculate and Display Area of a Circle.

Formula:

Perimeter of circle=pi * radius * radius

Enter the radius of the circle as input. Now we use the given formula to calculate the area of the circle using formula.

Here is the source code of the Java Program to Calculate and Display Area of a Circle. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.

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

Hope it helps you....

Answered by 45mehul
0

Program

#include<stdio.h>

int main() {

float radius, area;

printf("\nEnter the radius of Circle : ");

scanf("%d", &radius);

area = 3.14 * radius * radius;

printf("\nArea of Circle : %f", area);

return (0);

Similar questions