-
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;
}
-
- 101
- Ajit Kumar Gupta
- 101
Ajit Kumar Gupta - Compilation Error
- Runtime Error
Correct Option: C
We are copying the value john to the name and then we are printing the values that are in the program.