0

How to find the largest number in a intenger using C++?(I try using for,while and array)

Ex: Input:671496 Output: 9

18th Mar 2023, 2:50 PM
Nguyễn Nguyễn Đức Duy
Nguyễn Nguyễn Đức Duy - avatar
3 Respuestas
+ 3
Do yourself and if you have doubt on your code then ask
18th Mar 2023, 2:55 PM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 1
Did you formulate your question properly? You are asking "how to find the largest number in an integer"? That question makes no sense unless you want to know the largest number that can be represented in an integer type (I assume you mean a 32bits integer type)
18th Mar 2023, 8:52 PM
cacgs
0
Use a "while" loop and make use of "%" modulo and "/" divide operators.
18th Mar 2023, 9:42 PM
rodwynnejones
rodwynnejones - avatar