Why is that?
btw, here is the code, any help is very appreciated!
import java.util.Scanner;
class StartoSlut {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Ange start: ");
int x = sc.nextInt();
System.out.print("Ange slut: ");
int y = sc.nextInt();
System.out.println("Med for-loop: ");
for(int z=x; x<=y; x++){
System.out.println(x);
}
System.out.println("Med while-loop: ");
while(x<=y){
x++;
System.out.println(x);
}
}

New Topic/Question
Reply




MultiQuote




|