EmbLogic's Blog

value of resistor color code using switch statement

#include<stdio.h>
int main()
{
char i;
printf(“Enter the value of i”);
scanf(“%c”,&i);
switch(i)
{
case ’0′:
printf(“Black”);
break;
case ’1′:
printf(“brown”);
break;

case ’2′:
printf(“Red”);
break;
case ’3′:
printf(“Orange”);
break;
case ’4′:
printf(“Yellow”);
break;
case ’5′:
printf(“Green”);

break;

case ’6′:

printf(“Grey”);
}

return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>