I'm trying to write a basic program that takes primary colors and shows the user a secondary color made from two inputted primary colors. Its been two years since I took a logic class and I'm not grasping programming. Here is my code I've been tinkering with. Thanks for any input.
//This program will help teach the user the primary colors as well as the
//addional colors that can be made by mixing the primary colors together.
#include <iostream>
#include <istream>
#include <string>
usingnamespace std;
int main()
{
string userName;
cout << "Enter your name ";
getline(cin, userName);
cout << "Hello " << userName << endl;
int blue;
int green;
int red;
cout << "There are three primary colors: blue, green and red. " << endl;
cout << "Pick two primary colors to see what new color is made: " << endl;
{
cin >> blue, green, red;
if (blue && green)
{
cout << "The secondary color made is cyan " << endl;
}
elseif (blue && red)
{
cout << "The secondary color is magenta " << endl;
}
elseif (green && red)
{
cout << "The secondary color made is yellow. " << endl;
}
}
system("pause");
return 0;
}