Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use MatLab to solve. E.3 Largest Digit Write a function named find Largest Digit that finds the largest digit in a integer. Some Tips:
Please use MatLab to solve.
E.3 Largest Digit Write a function named find Largest Digit that finds the largest digit in a integer. Some Tips: 1. To check if x is an integer - divide x by 1 and see if the reminder is 0. My Solutions 2. To pick the last digit -- divide x by 10 and find the reminder. The function rem() might be useful here. 3. To get rid of the last digit of x-- substract that reminder found in 1) from x and divide by 10 For example, the reminder of 12345/10 is 5 and (12345 - 5)/10 = 1234. 4. What kind of loop will allow you to go through all of the digits of x? Here are 4 example runs: >>>ld findLargestDigit (12345) >> largestD = findLargestDigit (-234) ld- largestD = 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started