AREA AND PERIMETER OF CIRCLE

    













AREA AND PERIMETER OF CIRCLE

//find area of circle and perimeter of circle.
package com.company;

import java.util.Scanner;
import java.io.*;

public class Main {

public static void main(String[] args) {

float radius;
Scanner input = new Scanner(System.in);
System.out.print("Enter radius of circle : ");
radius= input.nextFloat();
double area,perimeter;
area = Math.PI*(radius*radius);
perimeter = 2*Math.PI*radius;
System.out.println("Area of circle is : "+area);
System.out.println("Perimeter of circle is :"+perimeter);

}
}
Enter radius of circle : 12
12.0
Area of circle is : 452.3893421169302
Perimeter of circle is :75.39822368615503

Process finished with exit code 0

Sharaddha Nand Pandey Welcome You

Comments

Popular posts from this blog

the distance between two cities (in km is input through the keyboard. write a program to convert and print this distance in meter ,feet inches and centimeter.

CREATE UNIT CONVERTER APP

write a program to check whether a triangle is valid or not, when the threeangles of the triangle are entered through the keyboard. A triangle is valid if the sumof all the three angles is equal to 180 degrees