JavaScript Practice Questions

S.No Question
1. Write a program to print given format using document.write function.
*
***
*****
******
*******

2. Write a program to find out simple interest (SI).
3. Write a program to find out area of circle.
4. Find sum of first , third and fifth digit of 6 digit number.
5. Write a program for swapping of two integer variables using third variable.
6. Write a program to find gross salary (Hint :-GS=BS+DA+TA).
7. Write a program to convert temperature from degree Fahrenheit to Celsius.
8. Write a program accepts a character and find out corresponding ASCII value.
9. Write a program to convert days into years, weeks and months.
10. Write a program that accepts the age of person, find out the person is eligible for voting or not.
11. Write a program to accepts three numbers from user and calculate biggest number out of three numbers.
12. Write a program to show day of week according to user input by using switch case.
13. Write a program to show day of city name according to user input by using switch case.
14. Write a program for generating electricity Bill. Accept last month unit and current month unit from user, then calculate and print bill amount according to following condition:
0-150 charges 4 rs/unit
151-300 charges 6 rs/unit
301-500 charges 8rs/unit
>500 charges 10rs/unit
15. Write a code for call center (using nested switch case). E,g, 1 for prepaid, 2 for post paid. If 1 selected then show all the options for prepaid.
16. Write a program to calculate the income tax of an employee.
The tax slabs according to annual salary are :
upto rs.300000 tax is 0%
from rs.300000 to rs. 500000 tax is 10%
from rs.500000 to rs. 1000000 tax is 15%
more than 100000 tax is 20%
Note: 250000 is exempted from tax criteria
17. Write a program to print n natural number.
18. Write a program to print table of any given numbers.
19. Write a program that accepts a number from user calculate factor of a given number. .e.g. factors of 12 are 1,2,3,4,6,12.
20. Write a program to accept N number from user and check and print only palindrome numbers.
21. Write a program to accept N number from user and check and print only Prime numbers.
22. Take the numbers from user (until ten +ve numbers entered by the user), and print sum and average of these numbers.
23. Write a program to calculate factorial of a given number.
24. Write a program to print “Code Better” five times by using loop.
25. Write a program to calculate sum of digits of a number.
26. Write a program to print given below patterns:
* * * * *
* * * * *
* * * * *

27. Write a program to print given below patterns:
*
**
***
*****
*******
28. Write a program to print given below patterns:
A
AB
ABC
ABCD
ABCDE

29. Write a program to find square and cube of any number using function.
30. Write a program to print all natural numbers between 1 to n using recursion.
31. Write a program to print all even or odd numbers in given range using recursion.
32. Write a program to calculate factorial using function with argument and with return type.
33. Write a program to find cube of any number using function.
34. Write a program to calculate factorial using function with argument and with return type.
35. Write a program to find total number of alphabets, digits or special character in a string.
36. Write a program to find first occurrence of a character in a given string.
37. Write a program to take two strings as input from the user. Confirm that the strings are equal.
38. Write a Program to take input from user and find the length of a string,position.
39. Write a program to toggle case of each character of a string.
40. Write a program to input text from user and perform following operation
1.create an array
2.Add element into array
3.Add elements b/w array ( Ex:-in b/w position 3 & 4)
4.Remove element from an arry to is specific position
5.Display using button.
41. Write a program to search an element in an array.
42. Write a program to find sum of all array elements.
43. Write a program to find maximum and minimum element in an array.
44. Write a program to sort an array.
45. Write a program to count total number of even and odd elements in an array.
46. Write a program to insert an element in an array.
47. Write a program to check a person is eligible for voting or not,by creating object.
48. Create BankAccount Management App to store, delete records of Bank Account. Store accNo, customer name, balance.

Contact Us

Our Address

Plot No. 64, PU-4, Scheme 54, Behind C21 Mall near Hotel Holiday , AB Road, Indore Pin-code:452001

Email Us

contact@codebetter.in

Call Us

+91 88230 75444, +91 99939 28766

Loading
Your message has been sent. Thank you!