Identify the purpose!

1
2
3
4
5
6
unsigned int Func(unsigned int A, unsigned int B){
    if(A==0)
        return B;
    else
        return B+Func(A-1,B);
}

What does the above recursive function, written in c++, calculate ?

( A + 1 ) × B (A+1) \times B A × ( B 1 ) A \times (B-1) ( A 1 ) × B (A-1) \times B A × ( B + 1 ) A \times (B+1)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...