2005/06 – Fase scolastica – 02

Si consideri la seguente funzione:

Function funzione(): Integer;
Var
   contatore: Integer;
   sum      : Integer;
Begin
   contatore:=0;
   sum      :=0;
   While(contatore <= 4) Do
      Begin
         contatore:=contatore+1;
         sum      :=sum+contatore;
      End;
   funzione:=sum;
End;

Quale valore restituisce la funzione?

Risposte:

  1. 10
  2. 15
  3. 16
  4. Nessuna delle risposte precedenti.