157k views
0 votes
Help with Java code, need a formula for finding the circumference

Help with Java code, need a formula for finding the circumference-example-1
User Tseng
by
5.5k points

1 Answer

2 votes

import java.util.Scanner;

public class CodesCracker

{

public static void main(String[] args)

{

float r, circum;

Scanner s = new Scanner(System.in);

System.out.print("Enter the Radius of Circle: ");

r = s.nextFloat();

circum = (float)(2*3.14*r);

System.out.println("\\Circumference = " +circum);

}

}

User Tsury
by
5.7k points