Computer Science, asked by alishathapa139, 3 months ago

The following functions show() and calling() are a part of some class. Assume that the parameter n is greater than 1 when the function is invoked. It returns the value 1 when true otherwise it returns 0. Show the dry run/working.
void calling()
{
int f=2;
show(n,f);
}
int show(int n, int f)
{
if(n==f)
return 1;
if(n%f==0 || n==1)
return 0;
else
return(show(n,f+1));
}
i) What will the function show() return when the value of n is 11? [ 2 ]
ii) What will the function show() return when the value of n is 27? [ 2 ]
iii) In one line state what function show() is doing? [ 1 ] [​

Answers

Answered by sadaffatima301
0

Answer:

i) n%f==0

n=11,f=2;

(11%2==0||n==1)

return 1;

return(show(n,2+1));

3 is ans

ii) if(13%2==0)

return 0;

ans is 1;

iii) do it your self it's very easy

Explanation:

follow the question I will do it it's so easy so u can understand

Similar questions