![]() Equivalently, the number 6 is equal to half the sum of all its positive divisors: ( 1 + 2 + 3 + 6 ) / 2 = 6. Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself).Įxample : The first perfect number is 6, because 1, 2, and 3 are its proper positive divisors, and 1 + 2 + 3 = 6. Go to the editorĪccording to Wikipedia : In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself (also known as its aliquot sum). Write a JavaScript function which says whether a number is perfect. Write a JavaScript function which will take an array of numbers stored and find the second lowest and second greatest numbers, respectively. Write a JavaScript function which returns the n rows by n columns identity matrix. Note : There are six possible values that typeof returns: object, boolean, function, number, string, and undefined.ġ0. Write a JavaScript function which accepts an argument and returns the type. Note : A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.ĩ. ![]() Write a JavaScript function that accepts a number as a parameter and check the number is prime or not. Note : As the letter 'y' can be regarded as both a vowel and a consonant, we do not count 'y' as vowel here.Ĩ. ![]() Write a JavaScript function that accepts a string as a parameter and counts the number of vowels within the string. Go to the editorĮxample string : 'Web Development Tutorial'ħ. Write a JavaScript function that accepts a string as a parameter and find the longest word within the string. Write a JavaScript function that accepts a string as a parameter and converts the first letter of each word of the string in upper case. Go to the editorĪssume punctuation and numbers symbols are not included in the passed string.ĥ. Write a JavaScript function that returns a passed string with letters in alphabetical order. Write a JavaScript function that generates all combinations of a string. ![]() Write a JavaScript function that checks whether a passed string is palindrome or not? Go to the editorĪ palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.ģ. Write a JavaScript function that reverse a number. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |