Question
Please help me with my homework. Below will be the basic code, please complete those 'TO DO' 1, 2 and 3 and not change the
Please help me with my homework. Below will be the basic code, please complete those 'TO DO' 1, 2 and 3 and not change the other part of the code. The question will also be attached below. Thank you.
#include
using namespace std;
const int LEN = 5;
// TODO 1: Complete the function declaration of GCD(), takes 2 interger as parameter.
int GCD(){
// TODO 2: Complete the function implementation, return the GCD of 2 given number
}
int main(){
int Num[LEN];
int answer;
cout
for(int i = 0; i
cin >> Num[i];
}
cout
answer = Num[0];
for(int i = 1; i
// TODO 3: Complete the loop, to get the GCD of all input numbers.
}
cout
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started