Minimum decrements to make integer A divisible by integer B | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; void movesRequired ( int a , int b ) { int total_moves = a % b ; cout << total_moves << " STRNEWLINE " ; } int main ( ) { int A = 10 , B = 3 ; movesRequired ( A , B ) ; return 0 ; }