Title: Help
Rapa, confira direito...
----- Original Message -----
Sent: Monday, March 11, 2002 11:36
Subject: Re: [java-list] Recursividade

Retorna 1:

func é chamado 2 vezes, mas a não é incrementado

Luis Gustavo Giordano wrote:
003601c1c4ad$f3f090a0$[EMAIL PROTECTED]" type="cite">href="file://C:\WINDOWS\>
Alguém sabe qual o valor retornado da seguinte função:
 
public int func (int a, int b)
{
    if (b == 1)
        return a;
    else
        return a + func (a, b - 1)
}
 
Assumam valores de a = 1 e b = 2. Se possível, expliquem como vcs conseguiram chegar a alguma solução.

-- 
"'You guys (at Microsoft) still don't get it,' 
because it's sort of Java with reliability, productivity and security deleted."

					James Gosling


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 03/08/2002

Responder a