C: switch case with logical operator
- by Er Avinash Singh
While I am new to c and want help in this program
my code is :
#include<stdio.h>
#include<conio.h>
void main(){
int suite=2;
switch(suite) {
case 1||2:
printf("hi");
case 3:
printf("byee");
default:
printf("hello");
}
printf("I thought somebody");
getche();
}
I am working in turbo c and it shows no error and the output is
helloI thought somebody
Please, let me know how is this working ???
note :- here break is not the case as I intentionally left them.