1.

Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined. Note: Assume all required header files are already being included in the program.void main (){ cout<<"Enter an Alphabet : "; cin>>CH;switch (CH)case 'A'  cout<<"Ant"; Break;case 'B'  cout<<"Bear"; Break:}

Answer»

correct code is:

void main ()

{

char CH;

cout<<"Enter an Alphabet : "; cin>>CH; 

switch (CH)

case 'A' : cout<<"Ant"; Break;

case 'B' : cout<<"Bear"; Break:

}

}



Discussion

No Comment Found

Related InterviewSolutions