Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #include <conio.h>
  5.  
  6. int main()
  7. {
  8. char string[] = "dfgyugy3g4yu23g4t1fg1421d4rt21d4214yuf421ty";
  9. int i;
  10. int sum = 0;
  11.  
  12. for (i = 0; i < strlen(string); i++)
  13. {
  14. if (isdigit(string[i]))
  15. {
  16. printf ("%c\n", string[i]);
  17. sum++;
  18. }
  19. }
  20.  
  21. printf ("sum = %i", sum);
  22. getch();
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement