โ Back to Loops
Question 217
Largest Digit in a Number
Largest Digit in a Number
Read a positive integernfrom standard input and print its largest digit, with no trailing newline. For example, if the input is4821, print: 8 Inspect each digit withn % 10and keep the maximum.
Expected Output:
8
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.