Question: Description: Complete the following C programming exercises. Each program must include a comment header and line comments as described in class. 1. Program 4.9 (listed

 Description: Complete the following C programming exercises. Each program must include

Description: Complete the following C programming exercises. Each program must include a comment header and line comments as described in class. 1. Program 4.9 (listed below) reverses the digits of an integer typed in from the terminal. However, this program does not function well if you type in a negative number. Find out what happens in such a case and then modify the program so that negative numbers are correctly handled. For example, if the number -8645 is typed in, the output of the program should be 5468-. #include int main() { int number, right digit; printf ("Enter your number. "); scanf ("%i", &number); do { right.digit = number % 10; printf ("%i", right digit); number = number/ 10; } while number != 0); printf (" "); return 0; } 2. Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. So, if the user types in 932, the program should display two three nine Remember to display "zero" if the user types in just a 0

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!