Friday, July 31, 2009

Please help me?

1 to 15 is letter "B"


16 to 30 is letter "I"


31 to 45 is letter "N"


46 to 60 is letter "G"


61 to 75 is letter "O"





with this solution..





char bingo(int a)


{


if(a%26gt;=1 %26amp;%26amp; a%26lt;=15) return 'B';


else if(a%26gt;=16 %26amp;%26amp; a%26lt;=30) return 'I';


else if(a%26gt;=31 %26amp;%26amp; a%26lt;=45) return 'N';


else if(a%26gt;=46 %26amp;%26amp; a%26lt;=60) return 'G';


else if(a%26gt;=61 %26amp;%26amp; a%26lt;=75) return 'O';


else return '0';


}


main (void)


{


/* whatever has to be done */





}

















i need to use another control structure like switch-case or conditional operator...





in C programming please








please.. help

Please help me?
Thers no need of another control structure.n it makes no sense





just continue the coding.......





void main (void)


{


int i;





printf("Enter no");/* change the word u wanna add*/


scanf("%d",%26amp;i);


printf("The corresponding BINGO Char is %c",bingo(i));








}


No comments:

Post a Comment