Computer Applications
Write the program in Java to display the first ten terms of the following series:
0, 3, 8, 15,
Java
Java Iterative Stmts
32 Likes
Answer
public class KboatSeries
{
public void generateSeries() {
int term = 0;
System.out.print(term);
for (int i = 3; i < 20; i = i + 2) {
term += i;
System.out.print(", " + term);
}
}
}
Variable Description Table
Program Explanation
Output
Answered By
14 Likes
Related Questions
Write the program in Java to display the first ten terms of the following series:
1, -3, 5, -7, 9,
Write the program in Java to display the first ten terms of the following series:
1, 12, 123, 1234,
Write the program in Java to display the first ten terms of the following series:
1, 11, 111, 1111,
Write the program in Java to display the first ten terms of the following series:
0, 1, 2, 3, 6,