C++ Saved Program: ferrous-city

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


class Number
{
    int Num; 
    public:
    Number(int x = 0)
    {
        Num = x;
    }
    void Display(void)
    {
        cout<< Num;
    }
    void Modify(); 
};
void Number::Modify()
{
    int Dec;
    Dec = Num % 13; 
    Num = Num / 13; 
    
         if(Num  > 0 ) Modify()   ; 
         if(Dec == 10) cout<< "A" ; 
    else if(Dec == 11) cout<< "B" ; 
    else if(Dec == 12) cout<< "C" ; 
    else if(Dec == 13) cout<< "D" ;
    else               cout<< Dec ;
}
int main()
{
    Number objNum(130);
    objNum.Modify();
    return 0; 
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs