Question
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>>CB ;
switch(CH)
case 'A' · cout<<"Ant"; Break ;
case 'B' · cout<<"Bear"; Break;
}
Solution
void main()
{
cout<<"Enter an Alphabate:";
cin>>CH;
switch(CH)
{
case :'A' cout<<"Ant"; Break;
case :'B' cout<<"Bear: ; Break;
}
}
Is there an error in this question or solution?
Solution 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. Concept: Concept of Object Oriented Programming in C++.