Program
#include<stdio.h>
int main()
{
int x,n,i,j;
float sum=0,p,m;
printf("enter value of x : ");
scanf("%d",&x);
printf("enter limit n : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
m=x;
for(j=1;j<i;j++)
{
m=(m*x);
}
p=i/m;
sum=sum+p;
}
printf("\nsum of series : %f",sum);
}
Output:
enter value of x : 2
enter limit n : 4
sum of series : 1.625000
1 Comments
inobcal_pu_1997 Josh Lowe https://marketplace.visualstudio.com/items?itemName=ligcolmupu.Descargar-Space-Mercs-gratuita-2022
ReplyDeleteptarlambsamon