-
What is the output of this program?
#include <iostream>
using namespace std;
int main( )
{
char line[50];
cin.getline( line, 50, 'p' );
cout << line;
return 0;
}
-
- 50
- p
- Compilation Error
- It will print what we enter till character p is encountered in the input data
- None of these
Correct Option: D
The program will store all strings entered and will print them only when the character ‘p’ is encountered.