answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What is the algorithm for sum of n even numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Algorithm to find the sum of even numbers between 1 to 10?

sum = 0 for(n = 0; n <= 10; n += 2) sum += n;


Write algorithm compute sum of square of N numbers?

1. Design an algorithm to compute sum of the squares of n numbers?


What are the examples of algorithm in the flow chart?

TO find the sum of n numbers?


Write an algorithm find out the sum of first n odd numbers?

Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the open range (1:n)sum := 0val := 2while (val < n) do{sum := sum + valval := val + 2}return sumNote that you explicitly specified between 1 and n, which literally means both 1 and n should be excluded from the sum. 1 would be excluded anyway since it is not an even number, however if we wish to include n, then use the following algorithm instead:Algorithm: sum_evenInput: an integer, n, such that n>0Output: the sum of all even integers within the half-open range (1:n]sum := 0val := 2while (val


How write algorithm for finding the sum first ten even number?

Sum = 0 For N = 1 to 10 Sum = Sum + 2*N Next N Print Sum


What is formula to find sum of n even numbers?

There is no formula that will sum n even numbers without further qualifications: for example, n even numbers in a sequence.


Is the sum of two even numbers even or odd?

The sum of two even numbers is always EVENYes.Proof:We can consider an even number as 2*n, and an odd number as 2*n+1.The sum of two even numbers would be 2*n+2*m=2*(n+m), an even number.


Why is the sum of four consecutive numbers always even?

If n is the first number, n + n + 1 + n + 2 + n + 3 will be the sum, which is 4n + 6. 4n is always even, and 6 is even. Therefore, the sum of four consecutive numbers is always even.


What is the algorithm and flowchart to find Sum of natural numbers from 1 to10?

The general equation to find the sum of the numbers 1 to n is: (n*(n+1))/2So, for n=10, you have:(10*(10+1))/2(10*11)/2110/255


What is the formula to find sum of n even numbers?

Sum = n/2[2Xa1+(n-1)d] where n is last number, a1 is the first number &amp; d is the common difference between the numbers, here d=2 for the even /odd numbers. Sum = n/2 [2Xa1+(n-1)2]


How would you find the sum of the first 50 even numbers?

Sum of 1st n even numbers: count*average = n * (2 + 2*n)/2 = n * (n+1) Sum = 50 * (2+100)/2 = 50*51 = 2550


What is the formula to find out the sum of first n even numbers?

n*(n+1)