KnowledgeBoat Logo
|
LoginJOIN NOW

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

BlueJ output of Write a program in Java to print a series 1,4,7,10……… upto 12 terms.

Answered By

4 Likes


Related Questions