Javascript Exercises
Javascript Exercises
1. Write JavaScript code to take an input as positive integer from user. Check whether
no is single digit no, 2 digit number or 3 digit number.
2. Write JavaScript program that Calculates the difference between a given no & 13. If
the number is less than or equal to 13, it returns the difference. However, if the
number is greater than 13, it returns double the difference.
3. Write a JavaScript program to compute the sum of the two given integers. If the two
values are the same, then return triple their sum.
4. Write a JavaScript program to check a pair of numbers and return true if one of the
numbers is 50 or if their sum is 50.
5. Write JavaScript code to check whether the given 2 integer values are in the range 80
to 90, return true if either of one falls within the range.
6. Write a JavaScript program that checks whether the last digit of three positive
integers is the same.
7. Write JavaScript code to hide all the header tag on the page when they are clicked.
i) Double Click on paragraph to charge its background color
ii) Add another header after an existing onclick of button
iii) Display the no of list elements in the Console after clicking button
8. Write JavaScript Program that iterates from 1 to 100 for multiples of 3 it prints the
word fizz. Instead of the no 4 for multiples of five print the Buzz & for multiples of
both print the word fizz, Buzz