Computer Science, asked by sriruparoychoudhury, 7 months ago

write a program in java to print 1+4+27.... N terms​

Answers

Answered by darkghost486
0

Answer:

import java.util.Scanner;

class series

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter number of terms");

int n=sc.nextInt();

int sum=0;

for(int i=1;i<=n;i++)

{

sum=sum+(int)Math.pow(i,i);

}

System.out.println("Sum of series="+sum);

}

}

Similar questions