1.
Write a JavaScript program that accepts two numbers in two prompts and
displays the larger one in the console.
2. Write a JavaScript conditional statement to find the sign of a number. Display
an alert box with the specified sign.
Sample: 3
Output : The sign is +
Sample: -5
Output : The sign is -
3. Write a JavaScript program that accepts five numbers in five prompts and
displays the larger one in the console.
4. 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"
----------
----------
5. Write a JavaScript program which computes the average marks of the
following students Then, this average is used to determine the corresponding
grade.
The grades are computed as follows :
Range Grade
<60 F
<70 D
<80 C
<90 B
<100 A
6. Write a JavaScript program which iterates the integers from 1 to 100. But for
multiples of three print "Fizz" instead of the number and for the multiples of five
print "Buzz". For numbers which are multiples of both three and five print
"FizzBuzz".
7. Write a JavaScript program to construct the following pattern, using a nested
for loop.
*
**
***
****
*****