Source code for ORExerciseExample2.java:

public class ORExerciseExample2
{
	public static void main(String args[])
	{
		// ORExerciseExample2
		int x = 0;
		int y = 10;
		while ((x < 5) || (y > 5))
		{
			System.out.println("x = " + x);
			System.out.println("y = " + y);
			x++;
			y = y - 5;
		}
	}
}

Output from ORExerciseExample2.java:

x = 0 y = 10 x = 1 y = 5 x = 2 y = 0 x = 3 y = -5 x = 4 y = -10

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the ORExerciseExample2 application at the momement. You need to compile and run the source code first.

To run this program:


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR