+ 2
Can I use comparasion inside cases in c language? My code doesn't work!
9 Respuestas
+ 6
You want to use if statements for conditional operations (ex. age >= 40). A switch works like:
switch(age){
case 40:
case 45:
case 50:
et cetera
}
https://code.sololearn.com/cDGcG8QDFoxY/?ref=app
Check out this code, it helps clarify what you may want
+ 4
also insted of comparision I can use range num like this👇
case 100 ... 200 :
+ 4
exactly, thanx🌹
+ 3
Than if I want to use swich I must write each single age number ? no other way in swich?
+ 2
I got it now thank you 🌹
+ 2
yup it depends on what you want ,all cases works 👍
+ 2
ur welcome 🌹
+ 1
if you want a specific age you need to use switch case ,else you can use if-else case