1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Recursive

Discussion in 'C' started by KRV, Jul 26, 2013.

  1. KRV

    KRV New Member

    Joined:
    Dec 26, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    LEARNING
    Location:
    SRI LANKA
    I want to know what happens when a function in recursive has a function as the return valuse like below code how does it gives a return value to function on a upper level within recursive..

    int func(int n1, int n2)
    {
    if (n1 != 0)
    {
    v = n2*10 + n1%10;
    return func(n1/10, v);
    }
     

Share This Page