Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- public class Program
- {
- public static void Main()
- {
- int[,] numbers = {
- { 1, 2, 5, 6, 7, 8 },
- { 5, 7, 2, 6, 4, 8 },
- { 4, 12, 9, 11, 13, 8 },
- { -15, 3, 5, 6, 1, 8 }
- };
- int rowSum = 0;
- int rowSumNumber = 1;
- int columnMultiply = 1;
- int columnMultiplyNumber = 0;
- for (int i = 0; i < numbers.GetLength(0); ++i)
- columnMultiply *= numbers[i, columnMultiplyNumber];
- for (int j = 0; j < numbers.GetLength(1); ++j)
- rowSum += numbers[rowSumNumber, j];
- for (int i = 0; i < numbers.GetLength(0); ++i)
- {
- for (int j = 0; j < numbers.GetLength(1); ++j)
- Console.Write(numbers[i, j] + " ");
- Console.WriteLine();
- }
- Console.WriteLine("Multiply of first column is : " + columnMultiply);
- Console.WriteLine("Sum of second row is : " + rowSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement