0% found this document useful (0 votes)
2 views1 page

Javascript Questions

The document contains a list of JavaScript programming tasks focused on using conditional statements such as if, else, and switch. It includes exercises for finding maximum values, checking number properties, validating triangles, calculating grades, and determining gross salary based on basic salary. Each task is designed to enhance understanding of control flow in JavaScript.

Uploaded by

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

Javascript Questions

The document contains a list of JavaScript programming tasks focused on using conditional statements such as if, else, and switch. It includes exercises for finding maximum values, checking number properties, validating triangles, calculating grades, and determining gross salary based on basic salary. Each task is designed to enhance understanding of control flow in JavaScript.

Uploaded by

Ritik Yadav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IF, IF ELSE, IF ELSE IF QUESTION FOR BATCH 11 AM AND 3 PM

1. Write a JavaScript program to find maximum between two numbers using if else.
2. Write a JavaScript program to find maximum between three numbers if else if.
3. Write a JavaScript program to check whether a number is negative, positive or zero if else if.
4. Write a JavaScript program to check whether a number is divisible by 5 and 11 or not. Using if else.
5. Write a JavaScript program to check whether a number is even or odd using if else.
6. Write JavaScript program to check whether a year is leap year or not using if else.
7. Write a JavaScript program to check whether a character is alphabet or not using switch statement.
8. Write a JavaScript program to input any alphabet and check whether it is vowel or consonant using
switch statement.
9. Write a JavaScript program to input week number and print week day using switch statement.
10. Write a JavaScript program to input month number and print number of days in that month using
switch statement.
11. Write a JavaScript program to input angles of a triangle and check whether triangle is valid or not
using if else statement.
12. Write a JavaScript program to input all sides of a triangle and check whether triangle is valid or not
using if else statement.
13. Write a JavaScript program to calculate profit or loss using if else.
14. Write a JavaScript program to input marks of five subjects Physics, Chemistry, Biology, Mathematics
and Computer. Calculate percentage and grade according to following:
Percentage >= 90%: Grade A
Percentage >= 80%: Grade B
Percentage >= 70%: Grade C
Percentage >= 60%: Grade D
Percentage >= 40%: Grade E
Percentage < 40%: Grade F
15. Write a JavaScript program to input basic salary of an employee and JavaScript calculate its Gross
salary according to following using if else if statement.
Basic Salary <= 10000: HRA = 20%, DA = 80%
Basic Salary <= 20000: HRA = 25%, DA = 90%
Basic Salary > 20000: HRA = 30%, DA = 95%

You might also like