Home » C++ Programming » Questions and Answers » Question
  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. Runtime Error
    2. Garbage value
    3. Exception occur
    4. Compilation Error
    5. None of these
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



Your comments will be displayed only after manual approval.