-
What will be the output of the following C code?
#include <stdio.h>
struct Country
{
int code = 12;
char name[20];
};
void main()
{
struct Country c;
c.code = 15;
printf("England");
}
-
- Compilation Error
- Nothing
- England
- 15
- None of these
Correct Option: A
Compilation Error
main.c:4:18: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
int code = 12;
^
main.c: In function ‘main’:
main.c:10:10: error: ‘struct Country’ has no member named ‘code’
c.code = 15;