0
Primitive Operators Q1
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double pi = 3.14; int var = 4; double result = var * pi; System.out.printIn(result); } } My code as above but I can’t get the answer. Please help.
2 Respuestas
+ 3
Did you notice that the Scanner object is imported at the top and there is a scanner class inside the code?
It means you need to take input from the user.
int var = scanner.nextInt();
https://www.sololearn.com/learn/Java/2220/
It's small 'L' not capital 'i' in println
+ 1
Thank you Simba 👍🏼