-
What will be the output of the following C code?
#include <stdio.h>
struct Employee
{
int id = 5;
char emp_name[23];
};
void main()
{
struct Employee Emp;
Emp.id = 102;
printf("Interview Mania");
}
-
- Interview Mania
- Garbage value
- Compilation Error
- 102
- None of these
Correct Option: C
Compilation Error
main.c:4:16: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
int id = 5;
^
main.c: In function ‘main’:
main.c:10:12: error: ‘struct Employee’ has no member named ‘id’
Emp.id = 102;
^