Question 8946 – ISRO CS 2020
December 26, 2023Question 8901 – ISRO CS 2020
December 26, 2023Functions
|
Question 16
|
Consider the following recursive C function that takes two arguments
unsigned int rer ( unsigned int n, unsigned int r){
If (n > 0) return ( n%r + rer (n/r,r));
else return 0;
}
What is the return value of the function rer when it is called as rer (513, 2 )?
unsigned int rer ( unsigned int n, unsigned int r){
If (n > 0) return ( n%r + rer (n/r,r));
else return 0;
}
What is the return value of the function rer when it is called as rer (513, 2 )?
|
9
|
|
|
8
|
|
|
5
|
|
|
2
|
Question 16 Explanation:
Given input function is rer(513, 2)
Condition: n>0
Sum of bits=2 if they given 513. It represented in binary.
Condition: n>0
Sum of bits=2 if they given 513. It represented in binary.
Correct Answer: D
Question 16 Explanation:
Given input function is rer(513, 2)
Condition: n>0
Sum of bits=2 if they given 513. It represented in binary.
Condition: n>0
Sum of bits=2 if they given 513. It represented in binary.
