SHOW:
|
|
- or go back to the newest paste.
| 1 | int zahl, ergebnis; | |
| 2 | char Aw; | |
| 3 | do | |
| 4 | {
| |
| 5 | do | |
| 6 | {
| |
| 7 | - | if (i < 0) |
| 7 | + | |
| 8 | - | {
|
| 8 | + | |
| 9 | zahl = Convert.ToInt32(Console.ReadLine()); | |
| 10 | if (zahl < 0) | |
| 11 | - | } |
| 11 | + | ...ungültige ausgabe... |
| 12 | } | |
| 13 | - | while (i < 0); |
| 13 | + | while (zahl < 0); |
| 14 | ||
| 15 | ergebnis = 1; | |
| 16 | ||
| 17 | for (int i = 1; i < zahl; i++) | |
| 18 | {
| |
| 19 | ||
| 20 | ergebnis = ergebnis * i; | |
| 21 | ||
| 22 | } | |
| 23 | Console.WriteLine("Das Ergebnis ist " + ergebnis);
| |
| 24 | ||
| 25 | Console.Write("Wollen Sie das Programm wiederholen?(j/n)");
| |
| 26 | Aw = Convert.ToChar(Console.ReadLine().ToUpper()); | |
| 27 | } | |
| 28 | while (Aw == 'J'); |