A
A
B)
int[,] array = new int[4, 4];
int max = -100000000;
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
array[row, col] = int.Parse(Console.ReadLine());
if (array[row, col] > max)
{
max = array[row, col];
}
}
Console.WriteLine();
}
Console.WriteLine("The array looks like: ");
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
Console.Write(array[row, col] + " ");
}
Console.WriteLine();
}
Console.WriteLine("The biggest element is: " + max);
V)
Console.WriteLine("Hello, World!");
Console.WriteLine("Enter the elements of the array: ");
int[,] array = new int[4, 4];
int sum = 0;
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
array[row, col] = int.Parse(Console.ReadLine());
if (col > row)
{
sum = sum + array[row, col];
}
}
Console.WriteLine();
}
Console.WriteLine("The array looks like: ");
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
Console.Write(array[row, col] + " ");
}
Console.WriteLine();
}
Console.WriteLine("The sum of the elements above the diagonal is: " + sum);
G)
Console.WriteLine("Enter the elements of the array: ");
int[,] array = new int[4, 4];
int sum = 0;
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
array[row, col] = int.Parse(Console.ReadLine());
}
Console.WriteLine();
}
Console.WriteLine("The array looks like: ");
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
Console.Write(array[row, col] + " ");
}
Console.WriteLine();
}
Console.Write("The elements of column 0 are: ");
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
if (col == 0)
{
Console.Write(array[row, col] + " ");
}
}
}
Console.WriteLine();
Console.Write("The elements of column 2 are: ");
for (int row = 0; row < array.GetLength(0); row++)
{
for (int col = 0; col < array.GetLength(1); col++)
{
if (col == 2)
{
Console.Write(array[row, col] + " ");
}