Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Sum Matrix Main Diagonal
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { // Print 2D Array int [,] intMatrix = new int [3,3] {{1,2,3}, // הגדרת המערך {4,5,6}, {7,8,9}}; int sum=0; for( int row=0; row<intMatrix.GetLength(0); row++) // לולאה לסריקת השורות { sum += intMatrix[row,row]; // סכום } Console.WriteLine(sum); // הדפסה } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
UTC to Ireland time convertion v1.1
CommandForce3
TCP
Number of Digits in a Number
custom Generic Que Implementation
Doubt-" 1 parameter Gen _Derive_Class inherit the 2 parameter Gen_Base_Class"
655+99
Complex Variable Implementation in C#
|= Caching
Remove xmlns and select signle node
Please log in to post a comment.