# Calculate the circumference of a circle

• 2
• Locked
• Exercise
Well, we have a plan. Let's implement it. First, implement a method that calculates the circumference of a circle. To do this, you need to write the correct formula in the method and specify the arguments. But what about pi, which we know is 3.141592... and so on to infinity? We'll keep things simple: let pi = 3.14.
You can't complete this task, because you're not signed in.
ZlatimirIvanovLevel 8 , Sofia
7 May, 16:45
I got this answer - 31.400000000000002. Why?
Mike McKennaLevel 4 , Wilmington
14 April, 01:26
I learned that i didn't have to use double for radius . Also if i looked closer i would have had answer sooner
AndrewLevel 29 , Seattle
9 January, 16:33
This might come later but there hasn't been any discussion about why doubles are called doubles (eg. double precision).
Abhay KatreLevel 2
1 January, 07:50
What is wrong in my code? please suggest. package com.codegym.task.task01.task0129; /* Calculate the circumference of a circle */ public class Solution { public static void main(String[] args) { printCircleCircumference(5); } public static void printCircleCircumference(int radius) { double pi=3.14; double c = 2*pi*radius; System.Out.println(c);//write your code here } }
RomanLevel 41
2 January, 06:59
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
Lijo M LoyidLevel 6 , Delhi
15 February, 18:28
use lowercase 'o' in System.out
vikas guptaLevel 3 , Bareilly
14 October 2018, 06:02
/* The comment was deleted */
RomanLevel 41
16 October 2018, 05:50
Posting the solution in the comments is prohibited.