2/a + 3/a² + 4/a³ + 5/a⁴ + ..n
Answers
Answered by
0
Explanation:
This expression in Python
n = int(input ("Enter n no"))
for i in range(2,n+1):
v = i/math.pow(a,i-1)
print(v)
Answered by
1
Question:-
Write a program to print the sum of the series.
2/a+3/a²+4/a³+....
Program:-
This is written in java.
import java.util.*;
class Sum
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter the value of a: ");
int a=sc.nextInt();
System.out.print("Enter the value of n: ");
int n=sc.nextInt();
double s=0.0;
if(a!=0)
{
for(int i=1;i<=n;i++)
s+=(i+1)/Math.pow(a, i);
System.out.println("Sum of the series is: "+s);
}
else
System.out.println("Invalid Input... ");
}
}
Similar questions
English,
3 months ago
Hindi,
3 months ago
Math,
3 months ago
English,
7 months ago
CBSE BOARD XII,
11 months ago
CBSE BOARD X,
11 months ago