Gate2019 cs Q36

0. 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?

  • Option : D
  • Explanation :
    It will not print anything and will not terminate
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *