Question: Write the code for both problems in functions below the main function and call both from the main function. The functions should accept data from

Write the code for both problems in functions below the main function and call both from the main function. The functions should accept data from main, calculate and return the result to main. Getting data from the user and printing the results should be done in main. When completed, the main function should get input data from the user, call the functions, receive the results of the function calls, and print their results to screen. With c language.

1. An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a function to display each digit, starting with the rightmost digit. Your program should also determine whether or not the number is divisible by 9. Write a function that calculates the sum of the digits in an int, checks to see if the sum is evenly divisible by 9 and returns 1 for yes and 0 for no. Test it on the following numbers: n = 154368 n = 621594 n = 123456

Hint: Use the % and 10 operators to get the least significant digit and use / and 10 to remove the least significant digit.

Sample output:

Run 1: IS IT DIVISIBLE BY 9 Enter an integer: 154368 154368 is divisible by 9

Run 2: IS IT DIVISIBLE BY 9 Enter an integer: 123456 123456 is NOT divisible by 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!