package Arrays;

public class printSum {
	public static void main(String[] args){
		int[] arr = {1, 2, 3, 4, 5, 6, 7, 9, 12, 13};
		printSumToM(arr, 7);
		
	}
	static void printSumToM(int[] arr, int m){
		if(arr == null)
			return;
		int end = arr.length - 1;
		for(int i=0; i< end; i++){
			for(int j=end; j>i; j--){
				int sum = arr[i]+arr[j];
				if(sum>m){
					end--;
				}
				else if(sum < m){
					break;
				}
				else{
					System.out.println(arr[i] +" " +arr[j]);
					end--;
					break;
				}
			}
		}
	}
}

@@ -10,16 +10,132 @@
 rrays;%0D%0A
+/*%0D%0A   Given an array of sorted numbers and a fixed sum, find all pairs of numbers that add up to the given sum.%0D%0A*/
 %0D%0Apublic

Add explanation for printSum.java