‹ Back to the paper
The following function check( ) is a part of some class. What will the function check( ) return…
The following function check( ) is a part of some class. What will the function check( ) return when the value of (i) n=25 and (ii) n=10. Show the dry run/ working.
int check(int n)
{
if(n<=1)
return 1;
if( n%2==0)
return 1 + check(n/2);
else
return 1 + check(n/2 + 1);
}Answer
No answer yet.
From ISC 2020 Computer Science Paper 1, question 3.