Computer Science, asked by shariqansari02, 11 months ago

Write a series Java program 1,7,26,.....





shariqansari02: Sorry their is a correction it is 0,7,26
Anonymous: sure it is correct? i think it shud be 0,7,26
Anonymous: yep wait

Answers

Answered by imtiyazallam
4

Answer:

public class Number3 {

   public static void main(String[] args) {

       int i = 1;

       while (i <= 10) {

           if (i == 1) {

               System.out.print(1 + " ");

           } else {

               System.out.print((int)(Math.pow(i, 3) - 1) + " ");

           }

           i++;

       }

   }

}

Answered by aceboii
0

Answer:

public class series

{

  public static void main(String[] args)

     {

      int i = 1;

      while (i <= 10)

       {

          if (i == 1)

              System.out.print(1 + " ");

          else  

              System.out.print((int)(Math.pow(i, 3) - 1) + " ");

          i++;

      }

  }  

}

.

.

.

Hope it helps you :)

Similar questions