2004/05 – Fase scolastica – 04

Si consideri la seguente funzione:

Function calcola(n: Integer): Integer;
Begin
   If n = 1 Then
      calcola:=1
   Else If n = 2 Then
      calcola:=n*calcola(n-1)
   Else
      calcola:=n*calcola(n-1)*calcola(n-2)
End;

Quale valore restituisce se viene richiamata con parametro 5?

Risposte:

  1. 120
  2. 1400
  3. 414720
  4. nessuna delle precedenti.