150k views
3 votes
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and the year. End with newline.The program will be tested with inputs 1 2000, and then with inputs 5 1950. Ex: If the input is 1 2000, the output is:1/2000#include int main(void) {int birthMonth;int birthYear;cin >> birthMonth >> birthYear;cout << birthMonth << "/" << birthYear << endl;return 0;}

User Larson
by
5.4k points

1 Answer

3 votes

Answer:

Statement to get input values:-

cin>>birthMonth>>birthYear;

Statement for output:-

cout<<birthMonth<<"/"<<birthYear<<endl;

Step-by-step explanation:

The statements are in C++ language.

To get the input we use cin in C++ with >>.

We are taking the input of birthMonth and birthYear.

For printing we use cout .We have printed birthMonth then slash and then birthYear.

User Cnhk
by
5.2k points