# Can we make a c program, of which we tell two colors and it will tell what it is equals to?

Can we make a c program, of which we tell two colors and it will tell what it is equals to?

Example:

(Me): What is blue + red?

(Bot): Purple.

answered Nov 25, 2020 by (22,320 points)
This is just checking words. You can create all the possible combinations and check them.

If you really want to work with colors, they are represented by 3 color components on computers. These are typically red, green, blue.

For instance, the blue color is (0, 0, 1); i.e. 0 red, 0 green and 1 blue.

If you want deeper blue, you'd do (0, 0, 0.5) for instance.

So red (1, 0, 0) + blue (0, 0, 1) would result in (1, 0, 1).
commented Nov 25, 2020 by (500 points)
So, what is the program?
commented Nov 26, 2020 by (22,320 points)
It depends on what you want: simple word check, or actual arithmetics with colors.

Also, you could learn way more if you'd give it a go and try to do something first. Then ask questions, when you get stuck. ;)