const int MaxLottozahlenProZiehung = 7;
public static void Main()
int kleinsteLottozahl = 1;
int groessteLottozahl = 49;
Random rnd = new Random();
int[] lottozahlen = new int[MaxLottozahlenProZiehung];
for (int i = 0; i < MaxLottozahlenProZiehung; i++)
int gezogeneZahl = rnd.Next(kleinsteLottozahl, groessteLottozahl + 1);
lottozahlen[i] = gezogeneZahl;
string lottozahlenAlsString = string.Join(", ", lottozahlen);
Console.WriteLine(lottozahlenAlsString);