Write a program to find the sum of the following series:1,9,25,49,81....upto n terms
Answers
Answered by
0
Answer:
#include <stdio.h>
int main()
{
int i=0;
int a=0;
int j=0;
int total=0;
printf("Enter the number of terms\n");
scanf("%d",&a);
int x=0;
while(j<a){
x=0;
i=0;
while(i<=j){
x=x+i;
i++;
}
total=total+x;
j++;
}
int result=8*total+a;
printf("%d\n",result);
return 0;
}
Explanation:
.
Similar questions