C# program to Print Sum of factorial Series
Program Statement:
Write a program to display the sum of the following series.
2/1! + 4/3! + 6/5! + 8/7! + 10/9! + . . . + n/(n-1)!
Solution:
public class factorial
{
int n;
public void ser()
{
double f, sum = 2, res = 1, up = 2;
Console.WriteLine("\n\t\tSeries = 2/1! + 4/3! + 6/5! + 8/7! + 10/9! + . . . + n/(n-1)!");
Console.WriteLine();
Console.Write("\n\t\tEnter ending point : ");
n = Convert.ToInt16(Console.ReadLine());
for (int i = 2; i <= n; i++)
{
if (i % 2 == 1)
{
f = 1;
for (int x = i; x > 0; x--)
{ f = f * x; }
up = up + 2;
res = up / f;
sum = sum + res;
}
}
Console.WriteLine("\n\t\tSum : {0}\n", sum);
Console.WriteLine();
}
}
With an improvement in drug tests, ClearChoice immediately jumped to create the best synthetic urine on the market and succeeded! The cost reflects the ease and effectiveness of the product. As long as you use it right, the product will work flawlessly. It can also be used at a moment’s notice: just grab a vial, heat it up, and test away! You won’t find a better-quality product than the ClearChoice Quick Look Liquid Synthetic Urine. They have an incredible success rate and all the necessary chemical components to pass any drug test. When buying a ClearChoice product, whether it is the Quick Look or Sub Solution, always buy from the official site. We did our job: we went past page 10 of Google, digging through the internet for Quick Fix reviews Visit: https://www.urineworld.com/
ReplyDelete