Sum = n/2[2Xa1+(n-1)d] where n is last number, a1 is the first number & d is the common difference between the numbers, here d=2 for the even /odd numbers. Sum = n/2 [2Xa1+(n-1)2]
Chat with our AI personalities
sum = 0; for (int i = 12; i
jgfujtf
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
Sum = Sum + first number Sum = Sum + second number Sum = Sum + third number Average = 1/3 x Sum
17