4) Suppose x and y are int variables and ch is a char variable. Assume the following input data:
13 28 D
14 E 98
A B 56
What value (if any) is assigned to x, y, and ch after each of the following statements executes? (Use the same input for each statement.)
cin %26gt;%26gt; x %26gt;%26gt; y;
cin.ignore(50, ‘\n’);
cin %26gt;%26gt; ch;
======================================...
cin %26gt;%26gt; x;
cin.ignore(50, ‘\n’);
cin %26gt;%26gt; y;
cin.ignore(50, ‘\n’);
cin.get(ch);
======================================...
cin %26gt;%26gt; y;
cin.ignore(50, ‘\n’);
cin %26gt;%26gt; x %26gt;%26gt; ch;
======================================...
cin.get(ch);
cin.ignore(50, ‘\n’);
cin %26gt;%26gt; x;
cin.ignore(50, ‘E’);
cin %26gt;%26gt; y;
C++: need help......?
This is just handing us your homework. I'm not going to help you cheat. What parts have you done already, and where are you having problems?
Is there some restriction against typing in the code and data, and seeing what it does? After all, the compiler is the final arbiter.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment