Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

6-10. What are the three parts of Dunnings eclectic theory?

Answered: 1 week ago