2,10,30,68....
Solution using C language:
#include <stdio.h>
int main() {
int n ;
printf("Enter the range of the series\n");
scanf("%d",&n);
int sum = (n*(n + 1)/2) + (n*(n+1)/2)(n(n+1)/2);
printf("the sum of series till %d is %d", n,sum);
return 0;
}
Output:
Enter the range of the series
6
the sum of series till 6 is 462
No comments:
Post a Comment