The document provides a list of 20 JavaScript programming tasks, ranging from basic output to more complex calculations. Tasks include printing messages, performing arithmetic operations, calculating areas and perimeters, and checking conditions like even/odd and divisibility. It serves as a guide for practicing fundamental programming concepts in JavaScript.
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 ratings0% found this document useful (0 votes)
2 views3 pages
Javascript
The document provides a list of 20 JavaScript programming tasks, ranging from basic output to more complex calculations. Tasks include printing messages, performing arithmetic operations, calculating areas and perimeters, and checking conditions like even/odd and divisibility. It serves as a guide for practicing fundamental programming concepts in JavaScript.
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/ 3
JAVASCRIPT
1.Write a program that prints Hello, World! to the console.
2.Write a program that takes two numbers as input and prints their sum. 3.Write a program to find the greatest among three numbers 4. Write a program that checks whether a given number is even or odd. 5. Write a program that takes two numbers and an operator (+, -, *, /) as input, and then performs the corresponding operation. 6.Write a program that calculates the factorial of a given number using a loop(using for loop). 7.Write a program that calculates the sum of digits of a given number. eg-123=1+2+3. 8.Write a program that takes three numbers as input and calculates the average of the numbers. 9.Write a program that converts temperature from Celsius to Fahrenheit. The formula for conversion is: F=5/9×C+3 10.Write a program that calculates simple interest using the formula: SI=(P×R×T)/100 where , A is the amount after interest, P is the principal, r is the rate, 11.Write a program that calculates the area of a circle given its radius. The formula for the area of a circle is: eg-A=πr2 12. Write a program that calculates the area of a rectangle given its length and width. The formula for the area of a rectangle is: Eg- A=l×w 13.Write a program that calculates the area of a triangle given its base and height. The formula for the area of a triangle is: Eg- A=1/2×b×h 14.Write a program that calculates the perimeter of a rectangle given its length and width. The formula for the perimeter of a rectangle is. Eg- P=2×(l+w) 15.Write a program that calculates the perimeter (circumference) of a circle given its radius. The formula for the perimeter is: Eg- P=2πr 16.Write a program that checks if a given number is positive, negative, or zero. 17.Write a program that checks if a given number is divisible by 5 18. Write a program that accepts a student's marks (0-100) and prints the corresponding grade: If marks are 90 or above, print "A". If marks are between 70 and 89, print "B". If marks are between 50 and 69, print "C". If marks are between 35 and 49, print "D". If marks are below 35, print "Fail". 19.Write a program that checks in which quadrant a point (x, y) lies on the Cartesian plane: Quadrant 1: x>0x > 0x>0 and y>0y > 0y>0 Quadrant 2: x<0x < 0x<0 and y>0y > 0y>0 Quadrant 3: x<0x < 0x<0 and y<0y < 0y<0 Quadrant 4: x>0x > 0x>0 and y<0y < 0y<0 On the axes: x=0x = 0x=0 or y=0y = 0y=0 20.Write a program that accepts a person's age and prints the age group they belong to:
Age less than 13: "Child"
Age between 13 and 19: "Teenager" Age between 20 and 59: "Adult" Age 60 or above: "Senior"