Machine-translated by Google. Questions are authored in English.
Top

Discussion

What will be the output of the following C code?

#include <stdio.h>
enum sanfoundry
{
    a=1,b,c,d,e
};
int main()
{
    printf("%d",b*c+e-d);
}

 

  • A.Error
  • B.7
  • C.2
  • D.4

Answer: B

Correct answer: 7

Values run on from the one given: a = 1, so b = 2, c = 3, d = 4, e = 5. Then

\[ b \times c + e - d = 2 \times 3 + 5 - 4 = 7 \]

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

Post your comment

Please log in or register to post a comment.