Muhaiminur
2/12/2018 - 2:29 PM

Read_RadiusCircle_print_Circumference_Area

  1. Write a java program that reads the radius of a circle and prints its circumference and area.
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package BASICJAVA;

import java.util.Scanner;

/**
 *
 * @author ABIR
 */
public class Read_RadiusCircle_print_Circumference_Area {
    public static void main(String[]args){
     Scanner abir =new Scanner(System.in);
        System.out.println("Enter a number");
        Double radius=abir.nextDouble();
        Double area=Math.PI*Math.pow(radius, 2);
        Double cir=2*Math.PI*radius;
        System.out.println("your Circumference is = "+ cir);
        System.out.println("your Area is = "+ area);
    }
}