0% found this document useful (0 votes)
5 views3 pages

Condition_Task (1)

The document outlines a series of JavaScript programming tasks aimed at practicing conditional statements and basic arithmetic operations. Tasks include finding the largest integer among two numbers, computing average marks and corresponding grades, determining the greatest common divisor, and checking if a number is odd or even. Additional exercises involve summing multiples, printing the day of the week based on a number, and checking for leap years.

Uploaded by

kirtan savaj
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)
5 views3 pages

Condition_Task (1)

The document outlines a series of JavaScript programming tasks aimed at practicing conditional statements and basic arithmetic operations. Tasks include finding the largest integer among two numbers, computing average marks and corresponding grades, determining the greatest common divisor, and checking if a number is odd or even. Additional exercises involve summing multiples, printing the day of the week based on a number, and checking for leap years.

Uploaded by

kirtan savaj
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
You are on page 1/ 3

www.sughosh.

dev

Condition Practice Task​

1.​ Write a JavaScript program that displays the largest integer among
two integers.​

2.​ Write a JavaScript conditional statement to find the largest of five


numbers. Display an alert box to show the results.​
Sample numbers : -5, -2, -6, 0, -1​

3.​ Write a JavaScript program that computes the average marks of the
following students. Then, this average is used to determine the
corresponding grade.

Student name Marks


Dinesh 80

Vinod 77

Divya 88

Isha 95

Tax 68




The grades are computed as follows :

Range Grade

<60 F

<70 D

<80 C

<90 B

<100 A

4.​ Write a JavaScript program to compute the greatest common


divisor (GCD) of two positive integers.​

5.​ Write a JavaScript program to sum 3 and 5 multiples under 1000.​

6.​ Check if a number is odd or even in JavaScript.​


Note:- Get value from client/user​

7.​ Perform arithmetic operations on two numbers.​


Operations: + - * / %​

8.​ Give a number between 0 and 6. Write a program to print day of


week name using switch case​
number: 0 => day of week name: Sunday
number: 1 => day of week name: Monday
number: 2 => day of week name: Tuesday
number: 3 => day of week name: Wednesday
number: 4 => day of week name: Thursday
number: 5 => day of week name: Friday​
number: 6 => day of week name: Saturday
9.​ Write a program that takes a year from the user and check whether
that year is a leap year or not.​

10.​ Using the JavaScript switch statement to get the day count based
of a month​

Thank You1

1
Trunal Dudhatra​
+91 951 079 5391

You might also like