Computer Science, asked by fakeivanrobe, 2 days ago

Write a JAVA program to print the series 1 8 2464 125 ... 20 terms [ use while ( ) ]​

Answers

Answered by Sanskar260
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 07xxe
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