Answer the question
In order to leave comments, you need to log in
Is the program correctly written that calculates and displays the circumference of a circle if its radius is read from the keyboard?
And again the question guys, please answer.
I need to write a SUBJ program.
Is the program written correctly?
package pack;
import java.util.Scanner;
public class three {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
double a;
System.out.println("number");
a = sc.nextDouble();
double c = Math.PI * a;
System.out.println("" + c);
}
}
}
package pack;
import java.util.Scanner;
public classthree {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
double a;
System.out.println("number");
a = sc.nextDouble();
double c = 3.14 * a;
System.out.println("" + c);
}
}
}
Answer the question
In order to leave comments, you need to log in
Not right.
The circumference of a circle is not πr. Open your math textbook
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question