Write a menu driven Program that will accept first letter of rainbow
colour and print the whole word. (Rainbow colour:-VIBGYOR) [5M]
Eg:- Input :-- V Input:-- B
Output:-Violet. Output:- Blue
Answers
Officially, the rainbow color order is as follows:
Red
Orange
Yellow
Green
Blue
Indigo
Violet
This means that every rainbow you see will have these seven colors in this order (from the top of the arc of the rainbow to the bottom of the arc).
The easiest way to remember the rainbow color order is to use the mnemonic device ROYGBIV, in which each letter stands for the first letter of the color names (in other words, R is for red, O is for orange, Y is for yellow, etc.). Most people pronounce ROYGBIV in three syllables, making it sound and look more like the name of someone: Roy G. Biv.
Occasionally, you might see ROYGBIV written in reverse as VIBGYOR.
I'm willing to bet you can readily envision most, if not all, of these seven colors of the rainbow. But many people get confused about the color indigo and how it differs from blue and violet. Typically, indigo is described as being about halfway between blue and violet.
Most people seem to agree that indigo is closer to a deep or dark blue than it is a more purple or violet color, but there's still debate even about this!