+ 1
Why wont Java accept the input integer?
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 int r = input.nextInt(); double p = 2 * pi * r; System.out.println(p); } } This is one of the beginner problems and if I define r as the 'sample number' it works for that single instance, but the program wants to input other ones. My issue is that i cant seem to get it to communicate with my code to add its own inputs. Any help would be much appreciated! Best
2 Respuestas
+ 5
scanner.nextInt()
//not input
+ 1
Hima Thank you!