Computer Science, asked by debopriyasaha8605, 11 months ago

Rewrite the following code using if.....else if statement
Switch (direction)
{
Case "N" : a="North"; break;
Case "E" : a="East"; break;
Case "W" : a="West"; break;
Case "S" : a="South"; break;
Default : a="Enter correct code";
}
Document.write (a)

Answers

Answered by Paru44
1

Explanation:

{

if (direction =='N')

North;

if(direction=='E')

East;

if(direction=='W')

West;

else

enter correct code

}

Similar questions