Copy to Clipboard console.log("Print the following series using for loop:- 1,8,27,64,125,216,......n"); let n ; function cubeseriesloop(n){ for(let i=0; i =0){ console.log(cubei); }else{ break; } } } console.log(cubeseriesloop(9));
Write a program to print all odd numbers from 1 to n using for loops Example:- Input :- n=7 Output :- 1 3 5 7(JS)
Write a program to print all odd numbers from 1 to n using for loops Example:- Input :- n=7 Output :- 1 3 5 7 Copy to Clipboard console.log( "Write a program to print all odd numbers from 1 to n using for loops" ); let n ; function OddNum(n){ for(i=0; i