Java Programming : Write a JAVA Program of Sum of Series (1+X2+X3+X4+…………).

Posted on:
tags: ,

  Write a JAVA Program of Sum of Series (1+X2+X3+X4+…………).
import java.util.*;
public class a12 {
     public static void main(String args[])throws IOException

                 Scanner br = new Scanner (;
                 System.out.println("Enter the no. of terms");
                 int p = br.nextInt();

                System.out.println("Enter value of x");
                 int x = br.nextInt();

double s=0;
for(int i=0;i<p;i++)
System.out.println("sum is:"+s);
Enter the no. of terms
Enter value of x
sum is:15.0

1 comment:

  1. hey look up this wesite for, i worked be myself for 5 months to make it can share and download codes, ask or answer forum questions, and you can count your code lines from your whole life of programming, sincerely Emi


< >