write a program to find the sum of following series taking value of a and n from user s=a/2+a/3+a/4...........to n
Answers
Answered by
0
Answer:
dhdhdhdhruru to get the best time to the same time
Explanation:
gdgey is a great day mam I am present mam please see attached file is attached as
Answered by
2
Answer:
JAVA:
import java.util.*;
public class Brainly
{
static void main()
{
int i,n,a;
float s=0;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the value of a and n:");
a=sc.nextInt();
n=sc.nextInt();
for(i=2;i<=n;i++)
{
s=s+(float)a/i;
}
System.out.println("Sum="+s);
}
}
Similar questions