Questions and Answers


  1. To use internal linkage we have to use which keyword?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    static


  1. What is the default type of linkage that is available for identifiers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    external



  1. What will be the output of these two programs?
    (i)
    #ifndef Example_H
    #define Example_H
    int n = 251;
    #endif

    (ii)
    #include 
    #include "Example.h"
    using namespace std;
    int main(int argc, char * argv[] )
    {
    cout << num++;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In this program, we have created a header file and linked that into the source program and we post incrementing that because of that it is printed as 251.


  1. Which one is used to refer to program elements in any translation units?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In the external linkage, it is used to refer to identifiers in various programs.



  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    typedef int number;
    number P = 25, Q = 12;
    number R = P + Q + P - Q;
    cout << R;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program, we are manipulating the numbers and printing the result using user-defined data types.