Top

Discussion

What will be the output of the following C code?

main()
{
    enum resut {pass, fail};
    enum result s1,s2;
    s1=pass;
    s2=fail;
    printf("%d",s1);
}

 

  • A.error
  • B.pass
  • C.fail

Answer: A

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;

No comment is present. Be the first to comment.
Loading…

Post your comment