Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Test
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[3,3];
- Random rand = new Random();
- int row = 1;
- int column = 0;
- int sum = 0;
- int multipl = 1;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for(int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = rand.Next(1, 10);
- Console.Write($"{array[i,j]} ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- sum += array[row, i];
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- multipl *= array[i, column];
- }
- Console.WriteLine($"\nSum: {sum} | Multiplication {multipl}");
- }
- }
- }
Add Comment
Please, Sign In to add comment