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
#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;
}
Comments
Leave a comment