Computer Science, asked by snowflake86, 8 months ago

Consider the following if else if statement. Rewrite it with switch statement.

if(a==1)

cout<<"one";

else if(a==0)

cout<<"Zero" ;

else

cout<<"Not a binary digit" ;

Answers

Answered by harshithma7
3

Answer:

switch(a)

{

case:1 = system. out. println("one");

case:2 = system. out. println("zero") ;

break

system. out. println("not a binary digit") ; semicoln syntax not sure but rest all right

Answered by abhishek001konni
0

Explanation:

{

case 1: cout << “One”;

break;

case 0: cout<< “Zero”;

break;

default: cout << “ Not a binary digit”;

}

Similar questions