-
Write a function which can return the sum of two numbers.
function add(a,b){
…………………
}
var sum = add(45,67);
console.log(sum);
//Expected output: 112
-
Write a function which can return the greatest of the three numbers passed in arguments.
function compare(a,b,c){
…………………
}
var greatest = compare(45,67,23);
console.log(greatest);//67
-
Write a function which can print the given arguments in ascending order.
function sortNums(a,b,c){
…………………
}
var ascending = sortNums(45,7,68);
console.log(ascending);//
-
Write a function which can return the factorial of a number.
function fact(a){
…………………
}
var factorial = fact(4);
console.log(factorial);
-
Write a function which can to return the reverse of a given number.
function rev(a){
…………………
}
var reverse = rev(4);
console.log(reverse);
-
Write a function which can check a given number is prime number or not
-
Write a function which can check a given number is palindrome or not
-
Write a function to return the number of digits in the given number
-
Write a function that prints all even numbers between 1 and 20.
-
Write a function which can add two numbers
-
Write a function which can display the greatest of the three numbers passed in arguments.
-
Write a function which can display the given arguments in ascending order
-
Write a function which can display the factorial of a number
-
Write a function which can to display the reverse of a given number
-
Write a function which can check a given number is palindrome or not
-
Write a function which can check a given number is prime number or not
-
Write a function which can check a given number is armstrong number or not
-
Write a function which can return the factorial of a number to another variable
-
Write a function to display the number of digits in the given number
-
Write a function that returns an array of all even numbers between 1 and 20.
-
Cube of any number using the function.
-
Find diameter, circumference and area of a circle using functions.
-
Maximum and minimum between two numbers using functions.
-
Check whether a number is even or odd using functions.
-
Check whether a number is prime, Armstrong or perfect number using functions.
-
Find all prime numbers between the given interval using functions.
-
Print all strong numbers between the given interval using functions.
-
Armstrong numbers between the given interval using functions.
-
Print all perfect numbers between the given interval using functions.
-
Find the power of any number using recursion.
-
Print all natural numbers between 1 to n using recursion.
-
Print all even or odd numbers in a given range using recursion.
-
Sum of all natural numbers between 1 to n using recursion.
-
Find the sum of all even or odd numbers in a given range using recursion.
-
Find reverse of any number using recursion.
-
Check whether a number is a palindrome or not using recursion.
-
Find the sum of digits of a given number using recursion.
-
Find factorial of any number using recursion.
-
Generate nth Fibonacci term using recursion.
-
Find gcd (HCF) of two numbers using recursion.
-
Find lcm of two numbers using recursion.
-
Display all array elements using recursion.
-
Find the sum of elements of the array using recursion.
-
Find maximum and minimum elements in an array using recursion.
-
implement all the Array Assignments using Array Methods
-
implement all the Object Assignments and Array of Object Assignments
-
impletement string assingments using string methods