Computer Applications
Write a program in Java to print a series 1,4,7,10……… upto 12 terms.
Java
Java Iterative Stmts
8 Likes
Answer
public class KboatSeries
{
public static void main(String args[]) {
for (int i = 1; i <= 34; i += 3) {
System.out.print(i + " ");
}
}
}Output

Answered By
4 Likes
Related Questions
How many times will the following loop execute? Write the output of the code:
int x=10; while (true){ System.out.println(x++ * 2); if(x%3==0) break; }Write a program in Java to find the Fibonacci series within a range entered by the user.
Sample Input:
Enter the minimum value: 10
Enter the maximum value: 20Sample Output:
13Which of the following are entry controlled loops?
(a) for
(b) while
(c) do..while
(d) switch
- only a
- a and b
- a and c
- c and d