-
What will be the output of the following C code?
#include <stdio.h>
void main()
{
struct Employee
{
int id;
char emp_name[30];
};
struct Employee Emp;
id = 101;
printf("%d", id);
}
-
- Garbage value
- Compilation Error
- Nothing
- Null
- 101
Correct Option: B
Compilation Error
main.c: In function ‘main’:
main.c:10:9: error: ‘id’ undeclared (first use in this function); did you mean ‘void’?
id = 101;
^~
void
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in