Wap to generate 1,27,125,343,729
LuckyYadav2578:
in python
Answers
Answered by
0
a=int (input ("enter no. of series "))
for i in range ( 1, n+1)
.........b=i**3
.........print (b,end=' ' )
i hope its help ☆☆ :)
in place of dots there should be space :)
for i in range ( 1, n+1)
.........b=i**3
.........print (b,end=' ' )
i hope its help ☆☆ :)
in place of dots there should be space :)
Answered by
0
class Brainly
{
public static void main(String args[])
{
System.out.println("To print the following series: ");
System.out.println("1, 27, 125, 343, 729");
System.out.println("***************************"); //Can be ignored
int j = 1, cu = 0;
for( ; j < = 9 ; j = j + 2 )
{
cu = Math.pow( j , 3 );
if( j == 9)
System.out.print(cu);
else
System.out.print(cu + ", ");
}
}
}
Output:
To print the following series:
1, 27, 125, 343, 729
***************************
1, 27, 125, 343, 729
{
public static void main(String args[])
{
System.out.println("To print the following series: ");
System.out.println("1, 27, 125, 343, 729");
System.out.println("***************************"); //Can be ignored
int j = 1, cu = 0;
for( ; j < = 9 ; j = j + 2 )
{
cu = Math.pow( j , 3 );
if( j == 9)
System.out.print(cu);
else
System.out.print(cu + ", ");
}
}
}
Output:
To print the following series:
1, 27, 125, 343, 729
***************************
1, 27, 125, 343, 729
Similar questions