Advertisement
Guest User

Untitled

a guest
May 2nd, 2021
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int alpha_num(const char *str){
  4. static int i=0;
  5. static int counter=0;
  6.  
  7. if(i==strlen(str))return 0;
  8. if(str[i]>='A' && str[i]<='Z' || str[i]>='a' && str[i]>='z'){
  9. counter++;
  10. i++;
  11. return alpha_num(str);
  12. }
  13. else{
  14. counter++;
  15. return alpha_num(str);}
  16.  
  17. }
  18. int main(){
  19.  
  20. char word="myWord67this";
  21. printf("%d",alpha_num(word));
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement