Convert the given code into if......else
switch(x)
{
case 10: cost=1;
break; case 20: cost=2;
break; default:
cost=0; }
Answers
Answered by
1
Answer:
if(x==10)
{
cost=1;
}
else if(x==20)
{
cost=2;
}
else
{
cost=0;
}
Explanation:
Similar questions