Computer Science, asked by mrpm12876, 11 months ago

write a java program to accept a number from user and print the corresponding colour RGB according to it​

Answers

Answered by Anonymous
5

#include <stdio.h>

void main()

{

char color;

clrscr();

printf("Enter character (R/G/B): ");

color= getchar();

switch (color)

{

case 'R':

printf ("Red") ;

break;

case 'G':

printf("Green");

break;

case 'B':

printf("Blue");

break;

}

getch();

}

hope it helps you!

Answered by thakurojasvi935
5

Answer:

I hope it is helpful.

Explanation:

Switch (val)

{

Case 1:

System.out.println("color is red");

break;

Case 2:

System.out.println("color is green");

break;

Case 3:

System.out.prinln("color is blue");

break;

default:

System.out.println(Wrong choice")

}

Similar questions