you are given a bag of balls which consists of 3 colours (red, green and blue) . write a C program to arrange the balls such that (Red, green,blue)
Answers
Answered by
1
Answer:
r/R -Red
g/G-Green
b/B-blue
type
#include<stdio.h>
int main()
{
char ch;
printf( "Enter Character:");
scanf("%c", &ch);
printf("-------------/n ");
if(ch=='r' || ch== 'R')
{
printf ('RED');
}
elseif(ch=='g' || ch=='G')
{
printf('GREEN');
}
else if(ch=='b' || ch=='B')
{
printf('BLUE');
}
else
{
printf ( "Invalid input");
}
return 0;
}
Similar questions