2

//Write a C Program to evaluate the following series.
//S=x + x3 + x5 + x7.....into given numbers of terms.
#include<stdio.h>
#include<math.h>
void main()
{
	int sum=0,num,n,i,j=1;
	printf("\n Enter the Value : ");
	scanf("%d", &num);
	printf("\n How many Times to Run it : ");
	scanf("%d", &n);
	for (i=1; i<=n; i++)
	{
	sum=sum+pow(i,j);
	j=j+2;
    }
    printf("\n Sum = %d", sum);
}

Posted in Uncategorized
Write a comment