Working JS Algorithm examples

find the code on my github at https://github.com/Edgar256/js-algorithms




FIBONACCI ALGORITHM

The Fibonacci sequence is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the preceding two numbers.

Enter a number whose Fibonacci you want to find
The fibonacci of xx is xx

PALINDROMME

A palindrome is a word, phrase, or sentence reads the same backward or forward--such as Madam, I'm Adam. Semordnilaps (the word palindromes in reverse) are words that spell other words when spelled backwards (for example, star/rats, drawer/reward).

Enter a number whose word you to find if it is a Palindrom or not
xx is a ----> ( true )

STRING REVERSAL

Not only is the problem of reversing a string a very common question to be asked in a technical interview, it can so often be a step required in approaching so many other problems! Say we’re given the directions:

Write a function that, when given a string, will return a new string with the same characters in reversed order

Enter a text you what to reverse
xx has been reversed as xx

SMALLEST ANGLE BETWEEN CLOCK HANDS

Given hours and minutes hand position, return the smaller angle between the 2 hands

Example angleClock(12, 30) should return 165

Enter time to find smallest angle between Clock hands
The smallest angle is xx

AREA OR PERIMETER

You are given the length and width of a 4-sided polygon. The polygon can either be a rectangle or a square.

Example If it is a square, return its area. If it is a rectangle, return its perimeter.

Enter length and width
This is a xx

CONVERT NUMBER TO ROMAN NUMERALS

Given a number, convert it into its equivalent roman numeral

Example Given a number, convert it into its equivalent roman numeral

Enter length and width
In romans its xx