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

Basic Js

The document outlines a series of programming tasks including printing 'Hello, World!', swapping variables, finding the largest of three numbers, checking if a number is even or odd, summing numbers in an array, checking for palindromes, generating the Fibonacci sequence, reversing a string, counting vowels, calculating factorials, and finding prime numbers up to a given number. Each task specifies the expected functionality to be implemented in code. These tasks are suitable for practicing basic programming skills.

Uploaded by

Sweety Sonia
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)
2 views1 page

Basic Js

The document outlines a series of programming tasks including printing 'Hello, World!', swapping variables, finding the largest of three numbers, checking if a number is even or odd, summing numbers in an array, checking for palindromes, generating the Fibonacci sequence, reversing a string, counting vowels, calculating factorials, and finding prime numbers up to a given number. Each task specifies the expected functionality to be implemented in code. These tasks are suitable for practicing basic programming skills.

Uploaded by

Sweety Sonia
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

1. Print "Hello, World!

": Write a program that prints


"Hello, World!" to the console.
2. Swap Two Variables: Write a function to swap the
values of two variables without using a third
variable.
3. Find the Largest of Three Numbers: Write a
function that takes three numbers as input and
returns the largest one.
4. Check if a Number is Even or Odd: Write a
program that checks if a number is even or odd.
Sum of All Numbers in an Array: Write a function that
takes an array of numbers and returns the sum of all
the numbers.

Palindrome Check: Write a function that checks if a given string is a palindrome (reads the
same forward and backward).
 Fibonacci Sequence: Write a function to print the Fibonacci sequence up to n terms.
 Reverse a String: Write a function that takes a string as input and returns the reversed
version of the string.
 Count Vowels in a String: Write a function that counts the number of vowels (a, e, i, o,
u) in a given string.
 Find Factorial of a Number: Write a program that calculates the factorial of a number.
1.  Find the Prime Numbers: Write a function that returns an array of all prime
numbers up to a given number n.

You might also like