Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

getsmallestnumber

public static int getSmallestNumber(int input1) {
    int res =0;
    for(int i=2;i<10000;i++) {
        if(getSum(input1*i) == input1) {
        res = input1*i;
            break;
        }
            
    }
    return res;
}

static int getSum(int n) {    
    int sum = 0;
    while (n != 0) {
        sum = sum + n % 10;
        n = n/10;
    }
    return sum;
}
Comment

PREVIOUS NEXT
Code Example
Java :: No enclosing instance of type Main is accessible. Must qualify the allocation with an enclosing instance of type Main (e.g. x.new A() where x is an instance of Main). 
Java :: natural log in java 
Java :: android tab theme 
Java :: foreach() java 
Java :: java transformar string a url 
Java :: show bottom sheet in adapter 
Java :: varstatus foreach jsp 
Java :: java cambiar formato de fecha 
Java :: Marging ViewPager 
Java :: worldedit api copy schematic 
Java :: one space diagonally in java 
Java :: spring secutiry urls redirecting 
Java :: trier un tableau de string java 
Java :: primitive vs wrapper classes in java 
Java :: spigot disable health regeneration 
Java :: transform primitive float array to float array 
Java :: copy and deletion of div by pressing button in javasript 
Java :: Iterating an Array Using While Loop 
Java :: use flatpickr in javascripot 
Java :: java t point c# 
Java :: public static void nPrintln(String message, int n) { 
Java :: print jtable in java 
Java :: for-each Loop Sytnax JAVA 
Java :: Period java springboot 
Java :: how to add a hyperlink in a string in java mail 
Java :: path.resolve java 
Java :: how to make a string alphabetic 
Java :: java to exe 
Java :: Class inheritance and encapsulation 
Java :: java data structure interview questions 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =