Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. void my_atoi(char str[])
  5. {
  6. int i,l;
  7. l=strlen(str);
  8.  
  9. for(i=0; i<=l;i++)
  10. {
  11. if(str[i]>= '0' && str[i] <= '9');
  12. putchar(str[i]);
  13. }
  14.  
  15. }
  16.  
  17. int main()
  18. {
  19. char str[10];
  20.  
  21. printf("Enter a string:");
  22. gets(str);
  23.  
  24. my_atoi(str);
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement