What will be the output of the following C code? [code]main() { enum resut {pass, fail}; enum result s1,s2; s1=pass; s2=fail;

Thành Đạt

New member
What will be the output of the following C code?
Code:
main()
{
    enum resut {pass, fail};
    enum result s1,s2;
    s1=pass;
    s2=fail;
    printf("%d",s1);
}
A. error
B. pass
C. fail
D. 0
 
Answer: a
Explanation: The code shown above results in an error, stating : storage size of s1 and s2 unknown. There is an error in the declaration of these variables in the statement: enum result s1,s2;
 

Tìm kiếm

Back
Top