pleaseeeeeee answer it fast!!
Attachments:
QGP:
So, we take fixed values of "a" and "n" and then print the series sum?
Answers
Answered by
6
package Shruti;
import java.util.Scanner;
public class Series {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
int n=sc.nextInt();
int c=1;
System.out.print("(A+1)/3");
for(int i=2;i<=n;i++)
{
System.out.print(" + ");
System.out.print("(A+"+i+")/"+(2*i+c));
}
}
}
import java.util.Scanner;
public class Series {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
int n=sc.nextInt();
int c=1;
System.out.print("(A+1)/3");
for(int i=2;i<=n;i++)
{
System.out.print(" + ");
System.out.print("(A+"+i+")/"+(2*i+c));
}
}
}
Similar questions