Advertisement
Jakobhorak28

Untitled

Feb 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1.            double zahl, maxiumum;
  2.  
  3.  
  4.             Console.WriteLine("Maximum Bestimmen - Heiligenbrunner");
  5.  
  6.             Console.WriteLine();
  7.             do
  8.             {
  9.                 maxiumum = 0;
  10.  
  11.  
  12.  
  13.                 while (true)
  14.                 {
  15.                     Console.Write("Bitte geben Sie eine Zahl ein (abbruch mit negativer Zahl): ");
  16.                     zahl = Convert.ToDouble(Console.ReadLine());
  17.  
  18.                     if (zahl >= 0)
  19.                     {
  20.  
  21.  
  22.  
  23.  
  24.                         if (zahl > maxiumum)
  25.                         {
  26.  
  27.  
  28.                             maxiumum = zahl;
  29.                         }
  30.                     }
  31.                     else
  32.                     {
  33.  
  34.  
  35.  
  36.                         break;
  37.                     }
  38.                 }
  39.  
  40.                 Console.WriteLine("Das Maxiumum beträgt " + maxiumum);
  41.  
  42.  
  43.  
  44.  
  45.                 Console.Write("Wenn Sie das Programm wiederholen möchten geben sie J ein: ");
  46.             } while (Console.ReadLine().ToUpper() == "J");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement