Logo
HTMLCSSJavaScriptReactjsnewContactUpdates

Get started today

HTMLCSSJavaScriptReactjsnewContactUpdates

Tools

Resume BuilderQR GeneratorVS Code Editor

Connect

GitHubWhatsApp Channel
function
lexical scope

Javascript Assignment

By Saket Bhatnagar•June 14, 2025•Beginner to Intermediate

Table of Contents

  1. practice questions

practice questions

  1. 1Write a program to find square and cube of a given number.
  2. 2Write a program to check if a given year is a leap year or not.
  3. 3Write a program to calculate the sum of the first 100 natural numbers.
  4. 4Write a program to check if a given number is even or odd.
  5. 5Write a program to print the sum of all even numbers from 1 to any given number.
  6. 6Write a program to print the sum of all odd numbers from 1 to any given number.
  7. 7Write a program to count the number of digits in a given number.
  8. 8Write a program to calculate the sum of the digits of a given number.
  9. 9Write a program to print the multiplication table of a given number.
  10. 10Write a program to reverse a given number. For example, if the input is 12345, the output should be 54321.
  11. 11Write a program that prints the numbers from 1 to 100. But for multiples of three, print 'Fizz' instead of the number, and for multiples of five, print 'Buzz.' For numbers that are multiples of both three and five, print 'FizzBuzz.'
  12. 12Write a program to calculate the power of a number without using the Math.pow() function.
  13. 13Write a program to check if a given number is prime or not.
  14. 14Write a program to find and print all the prime numbers within 1-100.
  15. 15Write a program to calculate the factorial of a given number.
  16. 16Write a program to print the Fibonacci series up to a given number.
  17. 17Write a program to calculate the sum of the first 20 Fibonacci numbers.
  18. 18Write a program to check if a given number is a perfect number.
  19. 19Write a program to check if a given number is an Armstrong number.
  20. 20Write a program to check if a given number is a strong number.
  21. 21Write a program to check a number whose last digit is 7.
  22. 22Print the number which ends with 7 or is divided by 7.
  23. 23Print numbers up to 500 that are divided by 7 and end with 7.
  24. 24Write a program to print the factors of a number and also print the number of factors of that number.

Share this article

Last updated: July 14, 2025

Join Our Community

Login to Join

© 2025 Saket Bhatnagar. All rights reserved.

    ☕