Computer Science, asked by adfrt, 10 months ago

Write a program to enter the perimeter of a circle and find its radius

Answers

Answered by Anonymous
3

import java.util.*;

public class Radius

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

float p,r;

System.out.println("Enter the perimeter");

p=in.nextFloat();

r=p*(7/22)*(1/2);

System.out.println("The radius is"+r);

}

}

Answered by jack6778
4

#include<stdio.h>

int main()

{

int radius;

float PI=3.14,area,ci;

printf(" Enter the Radius of Circle: ");

scanf("%d",&radius);

area = PI * radius * radius;

printf("\n Area of a Circle : %f ",area);

ci = 2 * PI * radius;

printf("\n Circumference of a Circle is : %f ",ci);

return(0);

}

OUTPUT:

Enter the Radius of Circle: 5

Area of a Circle : 78.500000

Circumference of a Circle is : 31.400002

Similar questions