2- Write a C++ function that accept one input argument only. The input could be astring, int, float or double. If the input is string, the function returns its number ofcharacters. If the input is integer, the function returns its number of digits. If theinput is float, the function returns its number of digits before the point (for example,if the number is 8502.56, the function returns 4). If the input is double, the functionreturns its number of digits before the point and its number of digits after the point(for example, if the number is 120.5654, the function returns 3 and 4). Then, write aC++ program to test your function by entering the following values: “Quiz1” forstring, -5000 for int, 9864.1 for float, and 801.651237 for double.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here