C ++ implementation of above approach
#include <bits/stdc++.h> NEW_LINE using namespace std ; float successiveChange ( int arr [ ] , int N ) { float var1 , var2 , result = 0 ; var1 = arr [ 0 ] ; var2 = arr [ 1 ] ;