KnowledgeBoat Logo

Computer Applications

Write a program to print following series of numbers: 2, 5, 8, 11, 14….

Java

Java Iterative Stmts

9 Likes

Answer

public class KboatSeries
{
    public static void main(String args[]) {
        for (int i = 2; i <= 100; i += 3) {
            System.out.print(i + " ");
        }       
    }
}

Variable Description Table

Program Explanation

Output

BlueJ output of Write a program to print following series of numbers: 2, 5, 8, 11, 14….

Answered By

1 Like


Related Questions