Answer to Question #19073 in C++ for kshitij
write a program to print the sum of the following series : 1+(1*3)+(1*3*5)+.......N
1
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment