-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathColor_Code.java
More file actions
31 lines (31 loc) · 831 Bytes
/
Color_Code.java
File metadata and controls
31 lines (31 loc) · 831 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
import java.util.Scanner;
class color{
public static void main(String args[]){
Scanner n= new Scanner(System.in);
char i=n.next().charAt(0);
if(i=='V'|| i=='v'){
System.out.println("Violet");
}
else if(i=='I' || i=='i'){
System.out.println("Indigo");
}
else if(i=='B' || i=='b'){
System.out.println("Blue");
}
else if(i=='G' || i=='g'){
System.out.println("Green");
}
else if(i=='Y' || i=='y'){
System.out.println("Violet");
}
else if(i=='O' || i=='o'){
System.out.println("Orange");
}
else if(i=='R' || i=='r'){
System.out.println("Red");
}
else{
System.out.println(-1);
}
}
}