/* Part of Cosmos by OpenGenus Foundation */
import java.util.*;
public class Greatest_digit_in_number{
    public static void main(String args[]) {
        int num = 23238934;
        System.out.println(greatest_digit(num));
    }
    
    // returns greatest digit in a given number
    public static int greatest_digit(int n)
    {
        int max = 0;
        while(n != 0)
        {
            if(max<n%10) max=n%10;
            n/=10;
        }
        return max;
    }
}
@@ -95,16 +95,17 @@
 n_number
+%0A
 %7B%0A    pu
@@ -141,16 +141,21 @@
 args%5B%5D) 
+%0A    
 %7B%0A      
@@ -478,8 +478,9 @@
 %0A    %7D%0A%7D
+%0A

Update Greatest_digit_in_number