Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2019
Questions

Q26

MCQ2 marks, −0.67Algorithms

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 nn as argument?

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.