Java Script Questions
UNIT-1 :: Introduction
1. Write a program in JavaScript to add two integers take the input using
prompt function and show the output using alert.
2. Write a program in JavaScript to convert a temperature from centigrade
to Fahrenheit and vice versa.
3. Write a program in JavaScript to swap two numbers.
4. Write a program in JavaScript to check whether a number is even or odd.
5. Write a program in JavaScript to check weather in alphabet is vowel or
consonant.
6. Write a program in JavaScript to find all roots of a quadratic equation.
7. Write a program in JavaScript to find the largest among three numbers.
8. Write a program in JavaScript to check if a year is leap year or not.
9. Write a program in JavaScript to check whether a number is positive or
negative.
10. Write a program in JavaScript to calculate sum of in natural numbers.
11. Write a program in JavaScript to calculate sum of squares of n natural
numbers.
12. Write a program in JavaScript to compute factorial of a number.
13. Write a program in JavaScript to generate multiplication table of a
number take the input using prompt function.
14. Write a program in JavaScript to display Fibonacci series.
15. Write a program in JavaScript to calculate LCM and GCD of two numbers.
16. Write a program in JavaScript to calculate the number of digits of a
number.
17. Write a program in JavaScript to reverse a number.
18. Write a program in JavaScript to check if a number is palindrome or not.
19. Write a program in JavaScript to display Armstrong numbers between a
range using a function. The user must input the range.
20. Write a program in JavaScript to make a simple calculator that can
perform basic arithmetic operations.
21. Write a program in JavaScript to check whether a number can be
represented as a sum of 2 prime numbers.
22. Write a program in JavaScript to convert a decimal number to binary and
vice versa.
</debangshu_chakraborty>
23. Write a program in JavaScript to binary number to octal and vice versa.
24. Write a program in JavaScript to enter a list of positive integers
terminated by zero and then find the sum and average of the numbers.
25. Write a program in JavaScript to read in numbers end find the number of
positive negative and zeros.
26. Write a program in JavaScript to add two complex numbers.
27. Write a program in JavaScript to a person deposits rupees thousand in a
fixed account yielding 5% interest compute the amount in the account at
the end of each year for n years
28. Write a program in JavaScript to add two times.
29. Write a program in JavaScript to add two lengths expressed in feet and
inch.
30. Write a program in JavaScript to two compute the average of best of
three marks out of four subjects of a student. Input the marks from user.
</debangshu_chakraborty>