Find the number after successive division | C # implementation of the above approach ; Function to find the number ; Driver Code
using System ; class GFG { static int findNum ( int [ ] div , int [ ] rem , int N ) { int num = rem [ N - 1 ] ; for ( int i = N - 2 ; i >= 0 ; i -- ) { num = num * div [ i ] + rem [ i ] ; } return num ; } static public void Main ( ) { int [ ] div = { 8 , 3 } ; int [ ] rem = { 2 , 2 } ; int N = div . Length ; Console . WriteLine ( findNum ( div , rem , N ) ) ; } }