public class Main
{
    public static void main(String []args){
    int k = 17;
    int[] nums = new int[]{10,15,3,7};
    int total=0;
    int i;
    int j;
    
    for (i=0; i<nums.length; i++)
    {
        //This is ok
        //Now need another loop to complete addition
        
        for (j=0; j<nums.length; j++)
        {
            if (j==i )
            {
                j++;
                
            }
            
            if (j!=nums.length)
            {
                total = nums[i] + nums[j];
                System.out.println(nums[i] + "+" + nums[j] +"=" + total);
                
                if (total==k)
                {
                    System.out.println("Total is 17: " + nums[i] + "+" + nums[j] + "=" + total+"\n");
                    
                }
                
            }  //end of if loop (if index of j nested for loop has not reached end...)
            
        }  //end of inner for loop
        
    }  //end of outer for loop
        
    }  //end of main
    
}   //end of class