Write the followings as separate three functions that1. checks if an integer is five-digit and returns the result as an integer value (1 for true, 0 forfalse) (hint: you can either check the range or find the length of the number)2. returns the sum of the digits of any given integer (hint: use modulus and division operators)3. takes an integer as its first parameter, returns the left most and right most digit of thatnumber. (Notice that it returns 2 results at the same time) (hint: use pointers as function parameters,call the function by references)Write a main that uses the above 3 functions to find the sum of the digits and displays the left most andright most digits of given integers. The program stops when a five-digit number is entered.Example Run:Enter a digit number (to stop enter a five-digit number): 456735Sum of digits = 30Left most digit is: 4Right most digit is: 5Enter a digit number (to stop enter a five-digit number): 142212Sum of digits = 12Left most digit is: 1Right most digit is: 2Enter a digit number (to stop enter a five-digit number): 961862Sum of digits = 32Left most digit is: 9Right most digit is: 2Enter a digit number (to stop enter a five-digit number): 12345
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here