Can somebody please help me out !
i want to make program in which we input a integer and it gives output
the maximum number.
e.g if i give 1232 it will output the 3.
i have to make it without using any array or stack..
- keep track of the maximum number 'm'
- start 'm' at zero
- check each digit. If the digit is greater than 'm', them 'm' = that digit
- once all digits have been checked, output 'm'
Hints:
- The % operator returns the remainder after division (20 % 7 = 6)
- Use % and / to get one digit at a time
- It's OK to change the original input number in this process.