C Programming - Typedef - Discussion

Discussion Forum : Typedef - Find Output of Program (Q.No. 5)
5.
What will be the output of the program?
#include<stdio.h>

typedef struct error {int warning, err, exception;} ERROR;
int main()
{
    ERROR e;
    e.err=1;
    printf("%d\n", e.err);
    return 0;
}
0
1
2
Error
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Manasa said:   6 years ago
Can we write the semicolon inside a closing curly braces? Please tell me.

Rajkumar said:   1 decade ago
@Saravanan. C.

Here the variables are not declared as you have written.

Soudip said:   10 years ago
In this structure variables act as int (all variables). So output is 1.

Varad said:   1 decade ago
any one help me for this problem plzz...


Post your comments here:

Your comments will be displayed after verification.