Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    typedef int number;
    typedef char name;
    name n = "Interview Mania";
    number P = 12, Q = 25;
    number R = P + n;
    cout << R;
    return 0;
    }
    1. Interview Mania12
    2. 25Interview Mania
    3. Compilation Error
    4. Garbage Value
    5. Runtime Error
Correct Option: C

Error: invalid conversion from ‘const char*’ to ‘let {aka char}’.
Compilation Error

In function 'int main()':
7:18: error: invalid conversion from 'const char*' to 'name {aka char}' [-fpermissive]
8:24: warning: unused variable 'Q' [-Wunused-variable]



Your comments will be displayed only after manual approval.