//Mystery3.java
public class Mystery3
{
public static void main( String[] args )
{
int row = 10;
int column;
while ( row >= 1 )
{
column = 1;
while ( column <= 10 )
{
System.out.print( row % 2 == 1 ? "<" : ">" );
++column;
} // end while
--row;
System.out.println();
} // end while
} // end main
} // end class Mystery3
Showing posts with label Simple If. Show all posts
Showing posts with label Simple If. Show all posts
Mystery 2 - Java Sample Program
//Mystery2.java
public class Mystery2
{
public static void main( String[] args )
{
int count = 1;
while ( count <= 10 )
{
System.out.println( count % 2 == 1 ? "****" : "++++++++" );
++count;
} // end while
} // end main
} // end class Mystery2
public class Mystery2
{
public static void main( String[] args )
{
int count = 1;
while ( count <= 10 )
{
System.out.println( count % 2 == 1 ? "****" : "++++++++" );
++count;
} // end while
} // end main
} // end class Mystery2
Subscribe to:
Posts (Atom)