0% found this document useful (0 votes)
25 views

Advance Web Development by Tanvi Mam

Web Technology assignment

Uploaded by

Manish Raj
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)
25 views

Advance Web Development by Tanvi Mam

Web Technology assignment

Uploaded by

Manish Raj
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/ 14

Ques 1 - JavaScript Program to Check for Palindrome Number.

Output :-

12321 is palindrome: true

12345 is palindrome: false


Ques 2 - JavaScript
Program to Find the Area of Rectangle, Circle, Square and
Triangle (use functions)

Output :-

Area of Rectangle: 20

Area of Circle: 28.274333882308138

Area of Square: 36

Area of Triangle: 20
Ques 3 - JavaScript Program to Swap Two Variables (with and without using third
variable)

With Using a Third Variable –

Output :-

Before swapping: x = 5 and y = 10

After swapping: x = 10 and y = 5

 Without Using a Third Variable –

Output :-

Before swapping: p = 7 and q =

14 After swapping: p = 14 and q =

7
Ques 4 - JavaScript Program to Convert Celsius to Fahrenheit

Output :- 25 degrees Celsius is equal to 77 degrees Fahrenheit.

Ques 5 - JavaScript Program to Add the digits of a number

Output :- Sum of digits of 12345 is: 15


Ques 6 - JavaScript Program Check even or odd number

Output :-

12 is: Even

7 is: Odd

Ques 7 - JavaScript Program to Find Sum of n Numbers (numbers given as an


array)

Output :- Sum of numbers: 75


Ques 8 - JavaScript Program to Check Vowel or Consonant (use if-else loop)

Output :-

a is a vowel

b is a

consonant e is a

vowel
Ques 9 - JavaScript Program to Add, Subtract, Multiply, and Divide 2 numbers

Output :-

Addition: 15

Subtraction: 5

Multiplication: 50

Division: 2
Ques 10 - JavaScript Program to Find the Largest Among Three Numbers

(using if-else loop)

Output :- The largest among 10, 25, and 15 is: 25

Ques 11 - JavaScript Program for a simple calculator

Output :- Result: 15
Ques 12 - JavaScript program to demonstrate the use of var, const and let
keywords

Output :-

Using var, x is: 10

Using var, now x is: 20

Using const, y is: 30

Using let, z is: 50

Using let, now z is: 60


Ques 13 - JavaScript program to demonstrate use of synchronous and
asynchronous programming

Output :-
Synchronous task started

Synchronous task finished

Asynchronous task with callback started

Asynchronous task with promise started

Asynchronous task with callback finished


Callback executed

Asynchronous task with promise finished

Promise resolved

Ques 14 - JavaScript program to show Exception Handling (with use of try, catch
and throw)

Output :-
5

ERROR!

Error: Division by zero is not allowed

Ques 15 –
Ques 17 - JavaScript program with function that finds the longest word in a
sentence.

Output :- Longest word in the sentence: quick

Ques 18 - JavaScript program with a given an array containing numbers from 1 to


N, with one number missing, find the missing number.
Output :- The missing number is : 3

Ques 19- JavaScript program to find the First Non-Repeated Character in given
string ‘aabbccddeeffg’.

Output :- First non-repeated character : g


Ques 20 - JavaScript program to create a calculator with basic operations of
addition, subtraction, multiplication and division.

You might also like