Here's the programm code:
int magic(int a, int b) {
return b == 0 ? a : magic(b, a % b);
}
int main() {
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", magic(a, b));
return 0;
}
on input stream we have integers 4, 45
What's the output integer?
How many times will be initiated "magic" function?
Answer Posted / shams
2 times and answer is 45...
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
how to write a program that opens a file and display in reverse order?
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Code for Method of Handling Factorials of Any Size?
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
write a program to perform generic sort in arrays?
Code for Easily Using Hash Table?