int GCD(int x, int y) { //Swap if x < y if(x < y) { int t = x; x = y; y = t; } while(x%y) { int r = x%y; x =y; y = r; } return y; } void (*p[10]) (void (*)());
int GCD(int x, int y) { //Swap if x < y if(x < y) { int t = x; x = y; y = t; } while(x%y) { int r = x%y; x =y; y = r; } return y; } void (*p[10]) (void (*)());
No offence taken as the code is indeed ugly and does not even count as the last resort in real world probs. But as he suggested he had to do it according to the book so the suggestion... Should include a disclaimer...:-D