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


Please Help Members By Posting Answers For Below Questions

Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2065


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.)

4453


1+1/2!+1/3!+...+1/n!

1945


i don't know about working of nested for loop can any one help me

1794


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

2407






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+……………...

4353


Code for Two Classes for Doing Gzip in Memory?

2814


output for printf("printf");

1985


How can I Draw an ellipse in 3d space and color it by using graph3d?

2138


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.

1970


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3398


write a program that reads a series of strings and prints only those strings begging with letter "b"

2674


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2220


Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

3193


how to write a program that opens a file and display in reverse order?

2567