Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int main(int argc, char *argv[]) {
  7.         char text[] = "aoai 1skkfd 34kdwn 99";
  8.  
  9.         size_t len = strlen(text);
  10.  
  11.         printf("Digits: ");
  12.  
  13.         for (int i = 0; i < len; ++i) {
  14.                 char c = text[i];
  15.                 if (isdigit(c)) {
  16.                         printf("%c", c);
  17.                 }
  18.         }
  19.         printf("\n");
  20.  
  21.         return EXIT_SUCCESS;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement