Program to print the sum of the given nth term | JAVA program to illustrate ... Summation of series ; function to calculate sum of series ; Sum of n terms is n ^ 2 ; Driver code
import java . io . * ; import java . math . * ; import java . text . * ; import java . util . * ; import java . util . regex . * ; class GFG { static int summingSeries ( long n ) { return ( int ) Math . pow ( n , 2 ) ; } public static void main ( String [ ] args ) { int n = 100 ; System . out . println ( " The ▁ sum ▁ of ▁ n ▁ term ▁ is : ▁ " + summingSeries ( n ) ) ; } }