Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: 2 hoch Variable? Kategorie: Programmierung Basic (von Rene - 1.04.2004 13:05)
 Als Antwort auf 2 hoch Variable? von Simon - 1.04.2004 10:54
> Hallo!
>
> Wie kann man eine Gleichung mit einer Variablen als Hochzahl lösen.
> Z.B.
> 2³          Allgemein 2 hoch Variable
>
> Bitte um schnelle Antwort.
>
> mfg Simon


Hallo Simon !

Die Auflösung von 2³  lautet  2 * 2 * 2 = 8


Benutze eine Schleife um diese Multiplikation aus zuführen.

a = 2
variable = 3
c = 1

if  Variable = 0 then goto 10

For i = 1 To variable

 If i > 1 Then c = c * a Else c = a

Next i

10



 Antwort schreiben

Bisherige Antworten: