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
1
Explanation:
{
if (direction =='N')
North;
if(direction=='E')
East;
if(direction=='W')
West;
else
enter correct code
}
Similar questions