Function for Addition of Series of Numbers Increasing by 10 – CSKC
Sign In

Search

Solved Problem #CPP#5354    siteicon   siteicon  

Problem Statement - Function for Addition of Series of Numbers Increasing by 10

Write a function to find the sum of following series with any looping statement
12 + 22 + 32 ……… +72

Solution

TC++ #5354

 

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

Alternate (?) :

The required function can be written as follows.
int sumseries10(int n,int t)
{
int sum=0;
for(int i=0; i<t; ++i)
{
sum+=n;
n+=10;
}
return sum;
}

 

 


Share

Created: 9-Dec-2018 19:19 | Updated: 9-Dec-2018 19:29|