Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- int main()
- {
- //you can use ints and characters interchangeably in most cases
- int tuna = 'B'; // b, 7, $
- if( isalpha(tuna) ){
- if( isupper(tuna) ){
- printf("%c is an upper case letter \n", tuna );
- }else{
- printf("%c is a lower case letter \n", tuna );
- }
- }else{
- if( isdigit(tuna) ){
- printf("%c is a number \n", tuna );
- }else{
- printf("%c is not a OMG IDK! \n", tuna );
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement