SHARE
TWEET

Untitled

a guest Oct 14th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top