Computer Science, asked by dhruvdabeast1515, 10 months ago

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 akshayamca14
1

Answer:

if(x==10)

{

cost=1;

}

else if(x==20)

{

cost=2;

}

else

{

cost=0;

}

Explanation:

Similar questions