Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following input in the input stream, what would be stored in the variables after the following code executes. // Input stream : ab1%2Yu9

Given the following input in the input stream, what would be stored in the variables after the following code executes.

// Input stream : ab1%2Yu9

char ch;

cin.get(ch);

cout << "#Output 1 " << ch << endl;

cin.ignore(5, '%');

ch = cin.peek();

cout << "#Output 2 " << ch << endl;

cin.get(ch);

cin.putback(ch);

cin.get(ch); cout << "#Output 3 " << ch << endl; cin.get(ch); cout << "#Output 4 " << ch << endl;

system("pause");

return 0;

#Output 1 =

#Output 2 =

#Output 3 =

#Output 4 =

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

example of LEFT JOIN, RIGH JOIN, INNER JOIN.

Answered: 1 week ago