Recursion questions

Q26

GATE CS 2019 CSRecursionMCQ2 marks−2/3 if wrong
Consider the following C function:
void convert(int n){
    if(n<0)
        printf("%d",n);
    else {
        convert(n/2);
        printf("%d",n%2);
    }
}
Which one of the following will happen when the function convert is called with any positive integer n as argument?
Show answer without attempting

Answer: D

0/10 correct0 marks

Related topics in Programming and Data Structures