Questions and Answers


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    char ch[30];
    cout << "Enter Name: ";
    gets(ch);
    cout << "Name: ";
    puts(ch);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In this program,we need to string header file to run this program.
    Compilation Error

    In function 'int main()':
    7:18: error: 'gets' was not declared in this scope


  1. Identify the correct statement.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    By using typedef, we can create a type of pre-existing type only not our own type of data.



  1. Which keyword is used to define the user defined data types?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    typedef


  1. Which of the following header files is required for creating and reading data files?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In this fstream.h header file is used for accessing the files only.



  1. What does the data type defined by union will do?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Union is used to define the data types of our choice and it will store the data type in one location make them accessible.