Nested Loops #115 ( Ze think tank))

Code

/// Name: Amir Salehi
/// Period: 7
/// Program Name: Number Puzzles 1
/// File Name:NumberPuzzles1.java
/// Date Finished: 5/1/2016

    
    public class NumberPuzzles1
    {
        public static void main( String[] args )
        {
            System.out.println();
        
            
            for ( int x = 10; x <= 99; x++ )
            {
                for ( int y = 10; y <= 99; y++ )
                {
                    if ( x + y == 60 && x - y == 14 )
                    {
                        System.out.println( x + ", " + y );
                    }
                }
            }
            
            System.out.println();
        }
    }  






    

Picture(s) of the output

Assignment 7

Back to Homepage