C Programming Which Color? by CodeChum Admin My favorite color is blue. What's your favorite color? Never mind it doesn't matter, as long as you know how to identify which color is given. Instructions: Input a letter that represents the first letter of a color. Using conditional statements, check if the letter satisfies any of these conditions: If the letter is 'R' or 'r', print "Red" If the letter is 'B' or 'b', print "Blue" If the letter is 'G' or 'g', print "Green" If no condition is proven true, print "None of the above" Input 1. First letter of a color Output The first line will contain a message prompt to input the first letter of the color. The next line contains the appropriate message. Enter·the·first·letter·of·the·color:·r Red
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
C Programming
Which Color?
by CodeChum Admin
My favorite color is blue. What's your favorite color? Never mind it doesn't matter, as long as you know how to identify which color is given.
Instructions:
- Input a letter that represents the first letter of a color.
-
Using conditional statements, check if the letter satisfies any of these conditions:
- If the letter is 'R' or 'r', print "Red"
- If the letter is 'B' or 'b', print "Blue"
- If the letter is 'G' or 'g', print "Green"
- If no condition is proven true, print "None of the above"
Input
1. First letter of a color
Output
The first line will contain a message prompt to input the first letter of the color. The next line contains the appropriate message.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images