+ 1
I would say you don't need another function.
Theoretically this should work:
gcd(1, gcd(2,3))
+ 1
Sure :) You just need to convince yourself of the recursive step
gcd(ds(1..n)) = gcd(d(1), gcd(ds(2..n))
for a sequence of positive integers d(1), ..., d(n), where by ds(i..j) I mean d(i), ..., d(j).
This is a recursion over the length of the sequence. The base case being
gcd(d) = d
0
Use an array for all numbers.
Use a for loop.
https://www.tutorialspoint.com/cplusplus-program-for-gcd-of-more-than-two-or-array-numbers
0
Wonderful task to practise recursion :)
0
Yes, it would :)