Advertisement
Jakobhorak28

Untitled

Feb 13th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.            int zahl, ergebnis;
  2.             char Aw;
  3.             do
  4.             {
  5.                 do
  6.                 {
  7.  
  8.                         Console.Write("Zahl: ");
  9.                         zahl = Convert.ToInt32(Console.ReadLine());
  10.     if (zahl < 0)
  11. ...ungültige ausgabe...
  12.                 }
  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');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement