CSharp examples for System:Math Number
get Triangle Number
using System;//from w w w . ja v a2s .com public class Main{ public static int getTriangleNumber(int n) { var triangleNumber = 0; for (var i = 1; i <= n; i++) { triangleNumber += i; } return triangleNumber; } }