Write a JAVA program to print the series 1 8 2464 125 ... 20 terms [ use while ( ) ]
Answers
Answered by
1
class series
{
public static void main (String args[])
{
int i = 1;
while( i <= 20)
{
System.out.print( (int) Math.pow( i, 3 ) + " " );
i++;
}
}
}
Answered by
3
Answer:
import java.util.Scanner;
public class Series {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
int num = in.nextInt();
System.out.println(num + " ");
}
}
}
Similar questions
English,
1 day ago
English,
2 days ago
Social Sciences,
8 months ago
Science,
8 months ago
Math,
8 months ago