KnowledgeBoat Logo

Java Series Programs

Write the program in Java to display the first ten terms of the following series:

24, 99, 224, 399,

Java

Java Iterative Stmts

ICSE

52 Likes

Answer

public class KboatSeries
{
    public static void main(String args[]) {
        for (int i = 5; i <= 50; i = i + 5) {
            int term = (int)(Math.pow(i, 2) - 1);
            System.out.print(term + " ");
        }
    }
}

Output

BlueJ output of Write the program in Java to display the first ten terms of the following series: 24, 99, 224, 399,

Answered By

25 Likes