Write a program to find the following series upto n terms:
1,8,27....
Answers
Answered by
2
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,3);
System.out.println("The series is ="+b);
}
}
}
Explanation:
Since, it is a series of cube of the value.
Such that,
(1)^3 =1
(2)^3=8
(3)^3=27
And so on.
Answered by
0
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,3);
System.out.println("The series is ="+b);
}
}
}
Explanation:
Since, it is a series of cube of the value.
Such that,
(1)^3 =1
(2)^3=8
(3)^3=27
And so on.
Similar questions
English,
6 months ago
English,
6 months ago
Math,
6 months ago
Math,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago