Answer to Question #19073 in C++ for kshitij

Question #19073
write a program to print the sum of the following series : 1+(1*3)+(1*3*5)+.......N
1
Expert's answer
2012-11-21T08:23:17-0500
int main()
{

int N;
double sum;
printf("Enter number N= ");
scanf("%d",&N);
sum=1;
for(int i=1;i<=N;i++){
sum+=i*(i+2);
}


printf("
The sum = %f",sum);
printf("
Press any key to exit...");
scanf("%d",&N);

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS