Java Script Questions
Java Script Questions
JavaScript Programming
Practice questions
Q2. How find the sum of any FIVE numbers using FOR…NEXT loop.
Q3. How find the sum of any FIVE numbers using While loop.
Q4. How to print 0-------9 numbers with Text using while loop.
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 or even, and display a message to the
screen.
Sample Output:
"0 is even"
"1 is odd"
"2 is even"
----------
----------
Q7. Write a JavaScript program to check whether the number is ODD or EVEN
when a number is input.
91----100 is A*
81----90 is A
71----80 is B
61----70 is C
51----60 is D
41----50 is E
Sample Form:
//The HTML <span> tag is used for grouping and applying styles to inline elements. There
is a difference between the span tag and the div tag. The span tag is used with inline
elements whilst the div tag is used with block-level content.
<html>
<head>
<body>
<form>
</form>
<span id = "result"></span>
</p>
<script>
function multiplyBy()
num1 = document.getElementById("firstNumber").value;
num2 = document.getElementById("secondNumber").value;
function divideBy()
num1 = document.getElementById("firstNumber").value;
num2 = document.getElementById("secondNumber").value;
</script>
</body>
</html>