Question 11832 – Artificial-intelligence
April 14, 2024C-Programming
April 14, 2024Question 8806 – Programming
What will be the output of the following C program segment?
char inchar = 'A'; switch (inchar) { case 'A' : printf ("choice A n") ; case 'B' : printf ("choice B ") ; case 'C' : case 'D' : case 'E' : default: printf ("No Choice") ; }
Correct Answer: C
Question 18 Explanation:
Everything in the switch will be executed, because there is no break; statement after case ‘A’. So it executes all the subsequent statements until it find a break;
So,
→ Choice A
→ Choice B. No choice. Is the output.
So,
→ Choice A
→ Choice B. No choice. Is the output.
No Choice
Choice A
![](https://solutionsadda.in/wp-content/uploads/2020/01/t5-2.jpg)
Program gives no output as it is erroneous
Subscribe
Login
0 Comments