Q. What is the output of C program with switch statement or block?

Code:
int main()
{
    char code='K';
    
    switch(code)
    {
        case 'A': printf("ANT ");break;
        case 'K': printf("KING "); break;
        default: printf("NOKING");
    }
    
    printf("PALACE");
}
  • (A) KING PALACE
  • (B) KING NOTHING PALACE
  • (C) ANT KING PALACE
  • (D) Compiler error for using Non Integers as CASE constants.
πŸ’¬ Discuss
βœ… Correct Answer: (A) KING PALACE

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
183
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
97%
Success Rate