class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the size
of array");
int num = int.Parse(Console.ReadLine());
int[,] arr = new int[num, num];
Console.WriteLine("The given
format of your matrix: {0}", num * num);
for (int i = 0; i < num; i++)
{
for (int j = 0; j < num; j++)
{
arr[i, j] = int.Parse(Console.ReadLine());
}
}
Console.WriteLine("Your matrix
representation");
for (int i = 0; i < num; i++)
{
for (int j = 0; j < num; j++)
{
Console.Write(arr[i, j] + " ");
}
Console.WriteLine();
}
Console.WriteLine("your Water
matrix");
for (int i = num - 1; i >= 0; i--)
{
for (int j = 0; j < num; j++)
{
Console.Write(arr[i, j] + " ");
}
Console.WriteLine();
}
Console.WriteLine();
Console.ReadLine();
}
}
Output:
No comments:
Post a Comment