888 by CodeChum Admin This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck! Instructions: Input a 3-digit integer. Print the largest digit in the integer. Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2. Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41. Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer. Instructions Input one 3-digit integer. Print the largest digit in the integer. (Hint: use % 10 to get the rightmost digit and / 10 to remove it) Input A line containing a three-digit integer
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
888
by CodeChum Admin
This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!
Instructions:
- Input a 3-digit integer.
- Print the largest digit in the integer.
- Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
- Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
- Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.
Instructions
- Input one 3-digit integer.
- Print the largest digit in the integer. (Hint: use % 10 to get the rightmost digit and / 10 to remove it)
Input
A line containing a three-digit integer..
Step by step
Solved in 2 steps with 1 images