all about smartphone technologies we discuss here, ranging from specifications and prices, how to fix hp and we provide a lot of applications and games

program to print sum of series in C# using loops

program to print sum of series in C# using loops - welcome to our blog that presents a very complete information is Tech Phone ok now we will discuss the information you are seeking, may I guess if you are looking for information on program to print sum of series in C# using loops if properly come please continue reading until the end, we also provide other information, do not forget to get around:

informations : program to print sum of series in C# using loops
Full link : program to print sum of series in C# using loops
Article Csharp, Article programs,

You can also see our article on:


program to print sum of series in C# using loops

C# program to print sum of series

Program Statement:
Write a program to display the sum of the following series using loop.
1*x + 2*x2 + 3*x3 + 4*x4 + 5*x5 + … + n*xn

Solution:
 static void Main(string[] args)
{
int j, n = 1, x, lastn, sum = 0, prod = 1;
Console.WriteLine("Enter last digit:");
lastn=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter value of x:");
x = Convert.ToInt32(Console.ReadLine());
for (j = 1; j <= lastn; j++)
{
n = n * x;
prod = n * j;
sum = sum + prod;
}
Console.WriteLine("Sum of Series 1*x + 2*x2 + 3*x3 + 4*x4 + 5*x5 + … + n*xn when n=: " + n +" and x= "+ x+ "sum= "+ sum);
Console.ReadLine();
}




Articles program to print sum of series in C# using loops already been discussed

A few information about the program to print sum of series in C# using loops, hopefully can provide benefits to all of you.

You're reading an article program to print sum of series in C# using loops and this article has a link to https://mastispotgroup.blogspot.com/2013/12/program-to-print-sum-of-series-in-c.html to revel book mark. Hopefully this article could be useful, do not forget to look for information on obtaining the phone tech blog.

Tag : , ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : program to print sum of series in C# using loops

0 komentar:

Posting Komentar