Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpLight
- {
- public static class Program
- {
- public static void Main()
- {
- int sum = 0;
- int product = 1;
- int[,] numbers = { { 1, 2, 3, 4, 5 }, { 5, 6, 7, 8, 9 } };
- 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();
- }
- for (int i = 0; i < numbers.GetLength(1); i++)
- {
- sum += numbers[1,i];
- }
- Console.WriteLine(sum);
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- product *= numbers[i, 0];
- }
- Console.WriteLine(product);
- }
- }
- }
Add Comment
Please, Sign In to add comment