New JS Programs
New JS Programs
Cient-side Scripting
Program #3: - Define a variable name x , assign 27 to x and display the value of x.
Program #4: - Define a variable name CITY , assign “New Delhi” to CITY and display the message “capital
of India is New Delhi” using variable CITY.
Program #5: - Define two variable N1 and N2, assign some integer number to them, perform addition of
N1 and N2 in another variable SUM. Display the value of N1, N2 and SUM.
Program #5: - Define two variable L and B (Length and Breadth of rectangle), assign some integer
number to them, calculate the area and perimeter . Display the Length, Breadth, area and perimeter.
Program #6: - Define variable Eng, Hindi, Math, Science and SSc, assign marks in them from 50. Calculate
and Display the Total, average and percentage of marks.
Program #7: - Get the name of user using prompt method and display the message “Welcome NAME in
JavaScript class” , where name of user comes in place of NAME.
Program #8: - Get the age of user using prompt method and display his age with proper message.
Program #9: - Get the radius of circle from user, calculate the area and circumference of circle and
display.
Program #10: - Get the age of user and display the proper message if he/she is eligible to vote or not.
Program #11: - Get a character from user and check if it is vowel or not.
Program #11: - Get a number from user and check if it is Even or odd.
Program #10: - Get the age of user and based on his/her age show the category he/she belongs as per
table below
Age category
1-3 toddler
4-12 child
13-19 teen
20-60 Adult
Above 60 Old
Program #12: - Get three numbers from user, check and display the largest number.