Answer to Question #301798 in C++ for Izha

Question #301798



2. Three is a Crowd


by CodeChum Admin



This one’s pretty simple as well, but I hope you haven’t forgotten how to create a new line!







Instructions:



Input three random characters and make sure they are inputted on different lines.


Print out the three strings in order, each on a different line, using only 1 std::cout statement and newline characters (\n). An initial code with 1 std::cout is already provide for you. Don't add more std::cout's!


Input



Three lines containing a character on each.



A


B


C


Output



Three lines containing a character on each.



A


B


C

1
Expert's answer
2022-02-23T12:18:19-0500
#include <iostream>






int main() {
	char letter1;
	char letter2;
	char letter3;
	std::cin>>letter1;
	std::cin>>letter2;
	std::cin>>letter3;
	std::cout<<letter1<<"\n"<<letter2<<"\n"<<letter3<<"\n";


	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog