Write a function named removeDigit (function name is case sensitive) which takes two parameters: an integer pointer (say: p), and an integer (say x), respectively. The function should remove x digit (from the right) of the integer inside the address: p (divide the number to 10^x).
The given main program reads two integers: number and digit. Then calls your function removeDigit. You must fill in the parameters. Send the address of the number, and the value of the digit to the function, respectively.
As a result, that much digit of the number from the right should be removed. The program prints the
new version of the number to the screen.
Be careful: Just enter the two parameters between the given commented space, seperated by a comma. Don't add paranthesis, or semicolon. They are already given outside the commented space, and together they form a function call.
Assumptions/rules for input:
- The number will always have more than digit digits.
- The number and digit are positive.
- digit is smaller than 10.
Examples:
1923
1
|
192
|
12453
3
|
12
|
987654
5
|
9 |
Important issues about all exams/projects/quizzes:
- Update just Question.c file, not Question.txt.
- Make changes only between the following comments(DO NOT modify these comments or anything outside the region marked by the comments):
- // DO_NOT_EDIT_ANYTHING_ABOVE_THIS_LINE
- // DO_NOT_EDIT_ANYTHING_BELOW_THIS_LINE
- If you modify these comments for any reason, you can copy/paste the initial version from Question.txt into Question.c. Note that Question.txt is not graded at all, so anything you write in Question.txt will be discarded.
- To avoid getting the 'Binary Not Found' error, SAVE and BUILD your code before RUN.
- Do not add any extra messages message for input/output such as 'Enter an integer:', 'The result is:', etc. Any additional text that appears in the output will cause you to get no points from the question.
- Input and output of your program must be just like those in the Examples table above.