Assignement:Creating coordinates from NestedLoops that have a different of and sum of 40
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: NumPuzzle
/// File Name: NumPuzzle.java
/// Date Finished: 5/2/2016
public class NumPuzzle
{
public static void main( String[] args ) throws Exception
{
System.out.println();
for ( int n = 10; n < 99; n++)
{
for ( int j = 10; j < 99; j++)
{
if (n+j==60 && Math.abs(n-j)==14 )
System.out.print(" ("+n+","+j+") ");
}
}
System.out.println();
}
}
/// s
Picture of the output