1+2+3------+N
using
System;
namespace
sumtion_serise
{
class Program
{
static void Main(string[]
args)
{
int
i, sum = 0, n;
Console.WriteLine("Enter the value of N=");
n = Convert.ToInt32(Console.ReadLine());
for
(i = 0; i <=n; i++)
{
sum =sum+i;
}
Console.WriteLine("the result of=={0}",sum);
Console.ReadKey();
}
}
}
No comments:
Post a Comment