Computer Science, asked by ser81, 9 months ago

Write a program to find the following series upto n terms:
1, 16, 81....

Answers

Answered by itzsupercrusher
4

Answer:

import java. util.*;

public class Series

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

int n, a,b;

System.out.println("Enter the value of n");

for(a=1; a<=n;a++);

{

b=Math.pow(a,4);

System.out.println("The series is ="+b);

}

}

}

Explanation:

Since, it is a series of the value to the power 4.

Such that,

(1)^4=1

(2)^4=16

(3)^4=81

And so on.

Answered by Anonymous
2

\huge\underline\mathfrak\red{Question}

Write a java program to find the following series upto n terms:

1, 16, 81....

_______________________________________________

\huge\underline\mathfrak\blue{Answer}

import java. util.*;

public class Series

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

int n, a,b;

System.out.println("Enter the value of n");

for(a=1; a<=n;a++);

{

b=Math.pow(a,4);

System.out.println("The series is ="+b);

}

}

}

______________________________________________

\huge\underline\mathfrak\green{Explanation}

Since, it is a series of the value to the power 4.

Such that,

(1)^4=1

(2)^4=16

(3)^4=81

And so on.

Similar questions