Functions, Part 21. Correct the program written in class that performs counting so that it will work correctly.2. Write a function, and a program to completely test this function, that will return the nth root of a number, either positive or negative, with the default root being 2. Roots can also be decimal values! (e.g. -0.5, 0.5, etc) Note that you will have to signify if the root is imaginary or not!!!!