write a switch Statement that will examine the value of char type variable called color and print one of the following message, depending upon the character assigned to color.
This is the c source code/program for: write a switch Statement that will examine the value of char type variable called color and print one of the following message, depending upon the character assigned to color.
A. RED, if either r or R assigned to color
B. Green, if either g or G is assigned to color
C. BLUE, if either b or B is assigned to color
D. BLACK, if other character assigned to color
/* a program to enter the character and print its equivalents color
programmed by:
Name : jitendra yadav /
#include <stdio.h>
#include <conio.h>
void main()
{
char ch;
printf(“Enter the character “);
scanf(“%c”,&ch);
switch(ch)
{
case ‘r’:
case ‘R’:
printf(“This is red color”);
break;
case ‘g’:
case ‘G’:
printf(“This is green color”);
break;
case ‘b’:
case ‘B’:
printf(“This is blue color”);
break;
default:
printf(“This is black”);
}
getch();
}








