-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColor_Code.java
More file actions
41 lines (41 loc) · 912 Bytes
/
Color_Code.java
File metadata and controls
41 lines (41 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.*;
class Color
{
public static void main(String args[])
{
Scanner input =new Scanner(System.in);
char a=input.nextLine().charAt(0);
if(a=='V' || a=='v')
{
System.out.println("Violet");
}
else if(a=='I' || a=='i')
{
System.out.println("Indigo");
}
else if(a=='B' || a=='b')
{
System.out.println("Blue");
}
else if(a=='G' || a=='g')
{
System.out.println("Green");
}
else if(a=='Y' || a=='y')
{
System.out.println("Yellow");
}
else if(a=='O' || a=='o')
{
System.out.println("Orange");
}
else if(a=='R' || a=='r')
{
System.out.println("Red");
}
else
{
System.out.println("-1");
}
}
}