Computer Science, asked by kritika2727, 1 year ago

write a program in java using do while loop to print following series

Attachments:

Answers

Answered by Rajdeep11111
0
import java.io.*;
class Series
{
public static void main (String args[])
{
BufferedReader buff = new BufferedReader (new InputStreamReader (System.in));
int n, i = 1, j = 2;
System.out.print("Enter the number of terms: ");
n = Integer.parseInt(buff.readLine());
do
{
System.out.print((j*j*j) + " ");
j++;
i++;
}while (i <= n);
}
}

Rajdeep11111: alright?
kritika2727: I have not under stand it properly as I have not used pow any where .I am in class 9.
Rajdeep11111: ok wait then...
Rajdeep11111: ok?
Rajdeep11111: Math.pow(j,3) means j^3, that is, j*j*j
Similar questions