Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

While == in java example

public static void main(String[] args) {
  int myNumber = 1;
  while(myNumber != 1000) {
   if((myNumber % 2) != 0) {
    myNumber++; }
    else {
    System.out.println(myNumber + " is even");
    myNumber++;
   }
  }
}
Source by study.com #
 
PREVIOUS NEXT
Tagged: #While #java
ADD COMMENT
Topic
Name
1+3 =