Computer Science, asked by 89492anshull, 5 months ago

6.Write a JavaScript for loop that will iterate from 0 to 15. For each iteration, it will check if the current number is odd display its square or even display its cube​

Answers

Answered by tejaswinimogal11
1

Answer:

JavaScript conditional statements and loops [ 12 exercises with solution]

[An editor is available at the bottom of the page to write and execute the scripts.]

1. Write a JavaScript program that accept two integers and display the larger.Go to the editor

Click me to see the solution

2. Write a JavaScript conditional statement to find the sign of product of three numbers. Display an alert box with the specified sign. Go to the editor

Sample numbers : 3, -7, 2

Output : The sign is -

Click me to see the solution

3. Write a JavaScript conditional statement to sort three numbers. Display an alert box to show the result. Go to the editor

Sample numbers : 0, -1, 4

Output : 4, 0, -1

Click me to see the solution

4. Write a JavaScript conditional statement to find the largest of five numbers. Display an alert box to show the result. Go to the editor

Sample numbers : -5, -2, -6, 0, -1

Output : 0

Click me to see the solution

Similar questions