Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

progam that inputs a char and dislpays wether it is digit or not using logical and condition operators in c++

OpenStudy (anonymous):

what have you done?

OpenStudy (anonymous):

write progam in c++

OpenStudy (anonymous):

ans????

OpenStudy (anonymous):

#define yes 1 #define no 0 #include <iostream.h> int main(void) { char c[30]; int arr_size, result, i=0, state; cin>>"Enter your digit:= "; cout<<c<<endl; arr_size=(sizeof(c)/sizeof(c[0])); for(i; i < arr_size; i++) { if(check_digit(c[i])) state = yes; else state = no; } if(!state) cout<<It's not a digit<<endl; else cout<<It's a digit<<endl; system("\npause"); return 0; } enjoy.. int check_digit(char c) { return (c>='0' && c<='9'); }

OpenStudy (anonymous):

#define yes 1 #define no 0 #include <iostream.h> int main(void) { char c[30]; int arr_size, result, i=0, state; cin>>"Enter your digit:= "; cout<<c<<endl; arr_size=(sizeof(c)/sizeof(c[0])); for(i; i < arr_size; i++) { if(check_digit(c[i])) state = yes; else state = no; } if(!state) cout<<It's not a digit<<endl; else cout<<It's a digit<<endl; system("\npause"); return 0; } int check_digit(char c) { return (c>='0' && c<='9'); }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!