write a program in java using do while loop to print following series
Attachments:
Answers
Answered by
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);
}
}
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?
Similar questions