adplus-dvertising
frame-decoration

Question

What will be the value retuned by the following function, when it is called with a value 11?
recur(int num)
 if ( ( num/2) !=0 )
 return ( recur(num/2 ) * 10+num%2 );
 else return 1;

a.

Function does not return any value, because it goes into an infinite loop

b.

11

c.

1011

d.

None of these

Posted under Functions C Programming

Answer: (c).1011

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the value retuned by the following function, when it is called with a value 11?

Similar Questions

Discover Related MCQs

Q. The function that actually created from a call to a template function is called

Q. A function that is prototype as

int calculate(int num);

may

Q. A function that uses variable types is called

Q. A function that is prototyped as double calculate (int, num);
may

Q. The declaration

void function1(int)

indicates the function1 is a function which

Q. The function fprintf is used in a program

Q. The function is lower(char) checks whether a character is in lower case or not, therefore it should return

Q. If max is a function that returns the larger of the two integers, given as arguments, then which of the following statements finds the largest of three given numbers

Q. A function can make

Q. Let a, b be two non-negative integers. Which of the following calls, finds the positive difference of a and b ?

Q. Pick the correct statements

Q. max is a function that returns the larger of the two integers, given as arguments. Which of the following statements finds the largest of three given numbers?

Q. Forward declaration is absolutely necessary

Q. void can be used

Q. Feature for accessing a variable through its address is desireable because

Q. It is not advisable to use macros instead of functions because

Q. Which of the following is/are syntactically correct?

Q. Use of macro instead of function is recommended

Q. Which of the following is not a primitive recursive but partially recursive?

Q. Pick the correct statements.

I. The body of a function should have only one return statement
II. The body of a function may have many return statements.
III. function can return only one value to the calling environment.
IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.