good day to all,
please i need your guide on how to represent numbers from 10 and above(10,20,30,40,50,----100)as a character.i am working on a circuit that takes in character data for its operation,so i have declared a character variable to store the data but i am having problem with numbers from 10 and above.below is a sample of what i am doing:
i do not have problem with character '1' to '9',i am getting the expected output,but i can not figure out how to represent numbers from 10 and above as character.your guide and support will be highly appreciated in this regards.Code:#include<stdio.h int main() { char data; scanf("%c",&data); switch(data) { case '1': printf("today is sunday \n"); break; case '9': printf("today is monday \n"); break; case 10: printf("today is tuesday \n"); break; case 20: printf("today is wednesday \n"); break; case 100: printf("today is friday \n"); break; default: printf("you entered a wrong number"); break; } getch(); return 0; }
best regards.



1Likes
LinkBack URL
About LinkBacks


