Data Structures


  1. What is the output of this program?
    #include 
    #include
    using namespace std;
    int main()
    {
    struct Employee
    {
    int id;
    char name[20];
    };
    Employee emp;
    emp.id = 101;
    strcpy(emp.name, "Ajit Kumar Gupta");
    cout << emp.id << endl;
    cout << emp.name << endl;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    We are copying the value john to the name and then we are printing the values that are in the program.


  1. The declaration of the structure is also called as?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The structure declaration with open and close braces and with a semicolon is also called structure specifier.



  1. What will happen when the structure is declared?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    While the structure is declared, it will not be initialized, So it will not allocate any memory.


  1. What will be used when terminating a structure?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    While terminating a structure, a semicolon is used to end this up.



  1. The data elements in the structure are also known as what?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    members