#include #include #include unsigned int GCD_PR(unsigned int REGa, unsigned int REGb); main() { unsigned int ARRAY[32]; unsigned int Loop_Control_V, Reg1, Reg2, GCD, new_value; for ( int i = 0; i < 31; ++ i ) { new_value = i + ( 3 * (4) ); if ( new_value % 2 != 0 ) { new_value = new_value * 4; } else{ new_value = new_value * 10; } ARRAY[i] = new_value; } Loop_Control_V = 0; while ( Loop_Control_V < 30 ) { if ( ARRAY[Loop_Control_V] > ARRAY[Loop_Control_V + 1] ) { Reg1 = ARRAY[Loop_Control_V]; Reg2 = ARRAY[Loop_Control_V + 1]; } else { Reg1 = ARRAY[Loop_Control_V + 1]; Reg2 = ARRAY[Loop_Control_V]; } GCD = GCD_PR(Reg1,Reg2); //cout << " The GCD of "< temp2 ) { temp1 = temp1 - temp2; } else { temp2 = temp2 - temp1; } } GCD = temp1; return GCD; }