Is it possible to use switch case instead of if statements with the code below this text?
if number > 20
{
............
}
if number > 30
{
............
}
if number > 50
{
............
}
if number > 70
{
............
}Is it possible to use switch case instead of if statements with the code below this text?
if number > 20
{
............
}
if number > 30
{
............
}
if number > 50
{
............
}
if number > 70
{
............
}Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Aravind GovindarajPosted Jun 12, 2023, 11:54 AM
Yes you can use a switch statement for your use case, typically we use a switch clause is for
Vishal JoshiPosted Jun 12, 2023, 11:24 AM
Hello
Try the below code same logic with the switch case statement.
Thanks
Rajkiran SwainPosted Jun 12, 2023, 10:22 AM