Informatik- iterativ berechnen?

1 Antwort

Iterativ als Schleife wäre das zum Beispiel:

Function FAK(ByVal n as integer) as long

  dim i
 
  i   = 1
  FAK = 1
 
  While i <= n
    Fak = Fak * i
      i = i + 1
  Wend
 
End Function

Ich hoffe, das ist VBA, mit LibreOffice Basic und "Option VBASupport 1" funktioniert das jedenfalls.


Mathe224 
Beitragsersteller
 11.07.2024, 22:43

Danke!

0