You are given a menu choice and the required operand(s). Your task is to perform the selected scientific operation and return the result.
The available operations are:
Choice 1: Calculate the square root of a number.
Choice 2: Calculate the power of a base raised to an exponent.
Choice 3: Calculate the logarithm of a number to base 10.
Choice 4: Calculate the sine of an angle given in degrees.
Use a menu-driven structure to select and perform the appropriate operation. The operands are guaranteed to be within the valid domains for the chosen operation.
Examples
Example 1
Input: choice = 1, x = 16 Output: 4 Explanation: The square root of 16 is 4.