Hello, Everyone:
I am studying for my final exam on programming. I was checking from some previous exams that I got two input/output questions which I really don't understand how to figure out the answer.
Here are the programs:
Code:
#include <iostream.h>
int main()
{
char line;
cin >> line; // line 5
cout << line; // line 6
return 0;
}
The question is: If the input stream at line 5 is " CIS 101" (Note: " " represents blank space), The output at line 6 is:
??
and
Code:
#include <iostream.h>
int main()
{
int charCount;
char next;
const char NWLN = '\n';
charCount = 0;
while (next != NWLN)
{
cin.get(next); // line 10
charCount++;
cout.put(next); // line 12
}
cout << "The count is: " <<charCount; // line 14
return 1;
}
If the input at line 10 is "This is a test," what is the output at line 12?
Referring to the previous program, what would be the output at line 14?
Please someone help me how to interpret these question. I have a final comming up and really I don't understand these questions. I want to know to get the answer without using SSH.
Thank you....