when does the following while loop terminate?
ch=’D’;
while(‘A’<=ch &&ch <=’Z’)
ch= static_cast<char>(static_cast<int>(ch)+1;
1
Expert's answer
2012-11-16T02:30:04-0500
That means that while ((ch>='A')&&(ch<='Z')){ static_cast <char> (static_cast<int> (CH) +1);}
this means that static_cast <int> (CH) +1) givesthe unicode of elemnt (for exemple for A it is smth like 60, and for B it is 61) and static_cast <char> make again from int value ofunicode a char, so if we had ch='C', we receive ch='D', in on cycle. Loop will terminate when ch would be equal to 'Z'+1
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment