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

Discussion

#include "stdio.h"

typedef enum{
    Male=5, Female
}SEX;

int main()
{
  SEX var = Male;
  SEX var1 = Female;
  printf("%d %d",var, var1);
  return 0;

}

 

  • A.Male Female
  • B.0 1
  • C.5 5
  • D.5 6

Answer: D

Correct answer: 5 6

Male is set to 5, and Female, having no value of its own, continues from it at 6. Enumerators always resume counting from the last value given.

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

Post your comment

Please log in or register to post a comment.