Multiple choice general knowledge

void main() { struct { int EmpNo; } var; var.EmpNo=193149; printf("EmpNo: %d",var.EmpNo); }

  1. a. Compilation Error - Struct cannot be defined inside a Function

  2. b. Compilation Error - Struct cannot be defined without a name

  3. c. 193149

  4. d. 193149193149

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

C allows struct definitions inside functions - these are local struct types. They can even be anonymous (no tag name) when defining a variable. The code creates an anonymous struct with member EmpNo, assigns 193149, and prints it. Output is 'EmpNo: 193149'.