specific values in loops
From: Danny Gopie (ouygiytf_at_jhgvkuy.nl)
Date: 11/29/04
- Next message: Stefan Schulz: "Re: strange problem"
- Previous message: Oscar kind: "Re: case sensitivity in strings..."
- Next in thread: VisionSet: "Re: specific values in loops"
- Reply: VisionSet: "Re: specific values in loops"
- Reply: Oscar kind: "Re: specific values in loops"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Nov 2004 20:17:39 +0100
Hello
I want to print only the values in this loop that are smaller then the give
value "aantal"
Now it just print true, becoz System.out.println(a < aantal); is a boolean.
But how do i change this?
Danny
public class e211 {
public static void main(String[] args) {
String saantal = JOptionPane.showInputDialog(null,"Voer een getal
in","invoer getal",JOptionPane.QUESTION_MESSAGE);
int aantal = Integer.parseInt(saantal);
for ( int i = 0; i < 10; i++) {
int a = i * aantal;
if (a < aantal){
System.out.println(a < aantal);}
}
}}
- Next message: Stefan Schulz: "Re: strange problem"
- Previous message: Oscar kind: "Re: case sensitivity in strings..."
- Next in thread: VisionSet: "Re: specific values in loops"
- Reply: VisionSet: "Re: specific values in loops"
- Reply: Oscar kind: "Re: specific values in loops"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]