176k views
5 votes
Given the input data

January 25, 2005

and the input statement

cin >> string1 >> string2;

a. What is contained in each of the string variables after the statement is executed?

User Corno
by
7.4k points

1 Answer

3 votes

Final answer:

After the statement is executed, the variable string1 will contain 'January' and the variable string2 will contain '25,'.

Step-by-step explanation:

After the statement cin >> string1 >> string2;, the first word in the input data, 'January', will be stored in the variable string1. The second word in the input data, '25,', will be stored in the variable string2. However, please note that the comma (',') will be included as part of the string stored in string2.

User Paul Lockwood
by
8.2k points