c# program to print sum of series 1+2+3+....+n
using System; namespace SumOfSeries { class Program { static void Main(string[] args) { int sum = 0, i, n; Console.WriteLine("\n>>> C# Program to print Sum of Series 1+2+3+..+n <<<\n"); Console.Write("\n Enter the number of terms:"); n=Convert.ToInt32(Console.ReadLine()); for (i = 1; i <= n; i++) { sum += i; } Console.WriteLine("\n Sum of series upto {0} is : {1}", n, sum); Console.ReadLine(); } } }..
Output:
For C Program: C program to print sum of series 1+2+3+..+n
Great Explanation..Very good Example..
ReplyDeleteOnline CSharp
Training
C Sharp Training
Online C# Training from India
C Sharp Training in Chennai
C# Training
Online Dot Net Training
.net online Training
ASP NET Training
really nice informative contents.
ReplyDeletec sharp training course