// 1. Feladat:
int[]
tombok = new int[5];
tombok[0] = 2;
tombok[1] = -8;
tombok[2] = 7;
tombok[3] = 3;
tombok[4] = -2;
int ossz =
0;
for (int i = 0; i < tombok.Length; i++)
{
if (tombok[i]
< 0)
{
ossz = ossz + tombok[i];
}
}
Console.WriteLine(ossz);
// 2. Feladat
char[] kar
= new char[5];
for (int i = 0; i < kar.Length; i++)
{
Console.WriteLine("Add meg a(z) {0}. karaktert: ", i);
kar[i] = Convert.ToChar(Console.ReadLine());
}
Console.BackgroundColor
= ConsoleColor.Yellow;
Console.Clear();
Console.ForegroundColor
= ConsoleColor.Black;
for (int i = 0; i < kar.Length; i++)
{
Console.Write(kar[i]);
}
//3. feladat
Random rnd = new Random();
for (int i = 0; i
< 4; i++)
{
Console.Beep(rnd.Next(37, 32768),
1500);
Console.Beep(rnd.Next(37, 32768),
1200);
Console.Beep(rnd.Next(37, 32768),
1400);
Console.Beep(rnd.Next(37, 32768),
1000);
Console.Beep(rnd.Next(37, 32768),
1599);
Thread.Sleep(1000);
}
Console.ReadLine();