Home » C++ Programming » Exception Handling » Question
  1. What is the output of this program?
    #include <iostream>
    #include <typeinfo>
    using namespace std;
    class N
    {
    };
    int main()
    {
    char ch; float n;
    if (typeid(ch) != typeid(n))
    cout << typeid(ch).name() << endl;
    cout << typeid(N).name();
    return 0;
    }
    1. c
      1N
    2. Compilation Error
    3. n
    4. 1c
      N
    5. None of these
Correct Option: A

We are checking the type id of char and float as they are not equal, We are printing c and 1N.



Your comments will be displayed only after manual approval.