PROFESSIONAL ACADEMIC STUDY RESOURCES WEBSITE +1 813 434 1028  proexpertwritings@hotmail.com

Computer Science Question

Description

Problem 1

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,

6! = 6 x 5 x 4 x 3 x 2 x 1 = 720

The value of 0! is 1, according to the convention for an empty product.

Write a function to find the factorial of a number using the for loop. Your function should take an integer n as input and returns n! as the result. Test your function by calling it in your main program.

Problem 2

C++ provides a math function called pow(x, y). Write your own function power with the following signature:

int power(int x, int y)

The function above should calculate and return xywithout using the available pow function.

Problem 3

Write a value-returning function, isVowel that returns the value true if a given character is a vowel and otherwise return false.

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *