I am new to C and need help. My code is the following.
#include #include void main() { int suite=2; switch(suit
case 1||2:
Results in
case 1:
because 1 || 2 evaluates to 1 (and remember; only constant integral expressions are allowed in case statements, so you cannot check for multiple values in one case).
1 || 2
1
case
You want to use:
case 1: // fallthrough case 2: