Home » C Programming » Decision Making » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    switch (name)
    {
    case 'n':
    case 'N':
    printf("Right...");
    }
    1. if (name== 'n')
      if (name== 'n') printf("Right...");
    2. if (name== ‘n’ || name== ‘N’) printf(“Right...”);
    3. if (name== ‘n’ && name== ‘N’) printf(“Right...”);
    4. All of above
    5. None of these
Correct Option: B

error: expected unqualified-id before 'switch'
switch (ch)



Your comments will be displayed only after manual approval.