Guest User

lol

a guest
Feb 13th, 2018
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1.            int zahl, ergebnis;
  2.             char Aw;
  3.             do
  4.             {
  5.                 do
  6.                 {
  7.                     if (i < 0)
  8.                     {
  9.                         Console.Write("Zahl: ");
  10.                         zahl = Convert.ToInt32(Console.ReadLine());
  11.                     }
  12.                 }
  13.                 while (i < 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