Question: JavaScript 1 . Write a loop to print all the positive even numbers from 2 to a user defined value in variable end. If the

JavaScript 1. Write a loop to print all the positive even numbers from 2 to a user defined value in variable end. If the variable end is less than 2, then your program will print there is no positive even number between 2 and the variable. Otherwise, print all the even numbers in between. var start =2; var end =10; console.log(Print positive even numbers between + start + and + end); //Your code goes here If start is 2 and end is 10, the output will be Print positive even numbers between 2 and 10246810 But if I change the value of end to 1, then the output will be Print positive even numbers between 2 and 1 There is no positive even number between 2 and 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!