Perimeter of a Circle

 Perimeter of a Circle

Problem Description


Java Program to calculate Perimeter of circle using radius

Logic Test Case 1


Input (stdin)

4


Expected Output


25.12

Logic Test Case 2


Input (stdin)

16


Expected Output


100.48


Code Area

import java.io.*;

import java.util.Scanner;

public class TestClass {

public static void main(String[] args)

     {

       Scanner s=new Scanner(System.in);

       double r=s.nextDouble();

       double c=2*r*3.14;

       System.out.println(c);

}

}

Post a Comment

0 Comments