Question from functions exercise

can anyone explain me what the problem statement means? (with example)

Q) Take sb (source number system base), db (destination number system base) and sn (number in source format). Write a function that converts sn to its counterpart in destination number system. Print the value returned

This problem is based on the concept of different number systems (binary, decimal, octal, hexadecimal, or in any other base…)

The Logic is to First convert the corresponding given source base to decimal and then convert the decimal base to Given destination base.
In short the Question is Any Base to Decimal and then Decimal to Any Base.

u can refer this -->

int conversion(int num, int sb, int db){
    // Any  Base to Decimal
        int ans = 0;
        int mult = 1;
        while(num != 0){
            int rem = num % 10;
            ans  = ans + rem * mult;
            mult = mult * sb;
            num = num / 10;
        }

     // Refresing the variables
        mult = 1;
        num = ans;
        ans = 0;

     //Decimal to Any number
        while(num != 0){
             int rem = num % db;
            ans  = ans + rem * mult;
            mult = mult * 10;
            num = num / db;    
        }  
        return ans;  
    }

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.