Computer Applications

Generate the following series upto 10 terms:

0, 3, 8, 15, 24, 35 …..

Java

Java Iterative Stmts

58 Likes

Answer

public class KboatSeries
{
    public static void main(String args[]) {
        for (int i = 1; i <= 10; i++) {
            int t = i * i - 1;
            System.out.print(t + " ");
        }
    }
}

Output

Answered By

23 Likes


Related Questions