[go: up one dir, main page]

0% found this document useful (0 votes)
9 views2 pages

New JS Programs

The document contains a series of JavaScript exercises designed for practice and learning. Each program focuses on different concepts such as variable declaration, user input, basic arithmetic operations, and conditional statements. The exercises include tasks like displaying messages, calculating areas, and checking user input for specific conditions.

Uploaded by

techytanzo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

New JS Programs

The document contains a series of JavaScript exercises designed for practice and learning. Each program focuses on different concepts such as variable declaration, user input, basic arithmetic operations, and conditional statements. The exercises include tasks like displaying messages, calculating areas, and checking user input for specific conditions.

Uploaded by

techytanzo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Exercises, Practice, Solution - w3resource

JavaScript Exercises, Practice, Solution - w3resource

Program #1: - To Display a message “JavaScript is very simple”.

Program #2: - To Display message

JavaScript can be used for

Cient-side Scripting

Server 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.

You might also like