Question: wirte in C++ In this problem, you will use a combination of iteration, the modulo operator, and the division operator to extract the individual digits

In this problem, you will use a combination of iteration, the modulo operator, and the division operator to extract the individual digits comprising an integer value. During this process, you will keep track of the largest digit you have observed. At the end of the process, you will return the largest digit to the caller. You will write your solution to this problem within the body of LargestDigit. Our auto-grader will invoke your definition of LargestDigit with different arguments that will become stored in the parameter number. Your solution should be written with respect to number. That is, you are to find the largest digit within number. For example, if our auto-grader calls LargestDigit(1234), your solution should return 4. Likewise, for Largest Digit(784), your implementation would return 8. You will define LargestDigit in fun.cc. You can test your implementation in driver.cc by calling Largest Digit with different arguments. JOWN 1. int LargestDigit(int number) { 2 3 // author your solution here 4 5} 6 7 4 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
