Computer Science, asked by pdamayantirao, 18 days ago

write a program to input a string and display it's characters in the following partten​

Answers

Answered by kartikaykumarn2121
1

Answer:

import java.util.Scanner;

class PAGE_Rainbow

{

public static void main (String arg[])

{

Scanner in = new Scanner(System.in);

int op;

System.out.println("1-V");

System.out.println("2-I");

System.out.println("3-B");

System.out.println("4-G");

System.out.println("5-Y");

System.out.println("6-O");

System.out.println("7-R");

System.out.println("ENTER YOUR CHOICE");

op=in.nextInt();

switch(op)

{

case 1:

System.out.println("VOILET");

break;  

case 2:

System.out.println("INDIGO");

break;

case 3:

System.out.println("BLUE");

break;

case 4:

System.out.println("GREEN");

break;

case 5:  

System.out.println("YELLOW");

break;

case 6:

System.out.println("ORANGE");

break;

case 7:

System.out.println("RED");

break;

default:

System.out.println("invalid option");

}  

  }

    }

Explanation:

plzmark me brainliest

Similar questions