WHILE-Übungsklausuraufgabe von Dr.Rothlauf
Programm zur Darstellung der WHILE-Programmierung / Berechnung der Laufzeitkomplexität, bzw. des Aufwandes
Programm zur Aufaddierung von n Zahlen
Programmcode
Ergebnis
Für verschiedene Anzahl n
// Deklaration der Variablen
// Start WHILE Schleife 1
// Start WHILE Schleife 2
Ergebnisse, bei n=2 a:2 b:2 c:4
r:16
Variable n
Variable r
1
4
2
12
3
24
4
40
5
60
6
84
7
112
8
144
9
180
10
220
11
264
12
312
13
364
14
420