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