Minimum decrements to make integer A divisible by integer B | Java implementation to count total numbers moves to make integer A divisible by integer B ; Function that print number of moves required ; Calculate modulo ; Print the required answer ; Driver code ; Initialise A and B
import java . util . * ; class GFG { static void movesRequired ( int a , int b ) { int total_moves = a % b ; System . out . println ( total_moves ) ; } public static void main ( String [ ] args ) { int A = 10 , B = 3 ; movesRequired ( A , B ) ; } }