0
primitive operator question 4 is not properly explained would like some help
2 Réponses
+ 5
The value of 2π is equal to 6.283.
And they are telling us to multiply 2π × radius and we are taking radius as the input.
So, if the radius is 4 =, so the calculation is 2π × 4 = 25.12.
The code is:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double pi = 3.14;
//your code goes here
System.out.println((pi * 2) * scanner.nextInt());
}
}