Sum of consecutive two elements in a array
Given an array print sum of the pairwise consecutive elements. Examples: Input : 8, 5, 4, 3, 15, 20 Output : 13, 9, 7, 18, 35 Input : 5, 10, 15, 20 Output : 15, 25, 35 The solution is to traverse the array and saving the sum of consecutive numbers in the variable sum. Implementation: C++ // C++ prog