Computer Applications
Generate the following series upto 10 terms:
1, 8, 27, 64, 125 ……..
Java
Java Iterative Stmts
41 Likes
Answer
public class KboatSeries
{
public static void main(String args[]) {
int a = 1;
for (int i = 1; i <= 10; i++) {
int t = a * a * a;
System.out.print(t + " ");
a++;
}
}
}
Output
![BlueJ output of Generate the following series upto 10 terms: 1, 8, 27, 64, 125 …….. BlueJ output of Generate the following series upto 10 terms: 1, 8, 27, 64, 125 ……..](https://cdn1.knowledgeboat.com/img/lgx8/c6-decision-control-p5a.jpg)
Answered By
18 Likes
Related Questions
Write a program using while loop to generate the first 10 natural numbers and their sum.
Program to check whether the product of two numbers is a buzz number or not.
[A number that ends with 7 or is divisible by 7, is called a buzz number]Generate the following series upto 10 terms:
0, 3, 8, 15, 24, 35 …..
Generate the following series upto 10 terms:
1, 4, 7,10 ……