Series 05

Given a number of terms the task is to calculate the value upto ‘n’ terms of the below given series.

Series: 12 + 23 + 34 + 45 + …………… + ‘n’ terms

C
#include <stdio.h>
#include <math.h>
void main()
{
    int n=0,result=0;
    printf("Enter number of terms: ");
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        result=result+pow(i,(i+1));
    }
    printf("Result of the series: %d",result);
}
C