(a) Rewrite the following using only switch case:
if(a>0)
System.out.print("Positive");
else if(aco)
System.out.print("Negative");
else
System.out.print("Zero");
Note: Additional variables can be used.
Answers
Answered by
1
Answer:
import java.util.*;
class numbers
{
public void main()
{
Scanner sc= new Scanner (System.in)
System.out.println ( Enter number);
int n= sc.nextInt()
switch (n)
{
case
Similar questions