Write a series Java program 1,7,26,.....
shariqansari02:
Sorry their is a correction it is 0,7,26
Answers
Answered by
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
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