0
van anybody help
i want it to write numbers smaller then your input import java.util.Scanner; public class Program { public static void main(String[] args) { int x = 0; for (int x; x < d; x++) { System.println (x); } Scanner sc = new Scanner(System.in); int d= sc.nextInt(); } }
3 odpowiedzi
+ 1
Well, code goes from top to bottom. You are first printing things and then asking for user input, while you should probably be doing it the other way around.
0
What do you want the program to do?
0
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
int x;
Scanner sc =
new Scanner(System.in);
int d=
sc.nextInt();
for (x=0; x < d; x++) {
System.out.println(x);
}
}
}