1.

char ch; cout<<“Enter a character”;cin??ch; Consider the above code, a user gives 9 to the variable ‘ch’. Is there any problem? Is it valid?

Answer»

There is no problem and it is valid since 9 is a character. Any symbol from the key board is treated as a character.



Discussion

No Comment Found

Related InterviewSolutions