Functions

Q1: What will be the output of the following program?
#include<iostream.h> 
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; 
}

A A0

B 90

C 130

D B0

ANS:A - 130

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.