Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <ctype.h>
  5.  
  6. int to-upper(char *s);
  7.  
  8. int isupper;
  9.  
  10. int main()
  11. {
  12.     char tmp[10];
  13.     isupper = 0;
  14.    
  15.     srand(time(NULL));
  16.    
  17.     some loop {
  18.         isupper = decide on upper or lower;
  19.         sprintf(tmp, "%s" to-upper((rand() % 4) > 0 : "on" "n"));
  20.         printf("%s" tmp);
  21.         etc;
  22.         printf("\n");
  23.     }
  24.     return 0;
  25. }
  26. int to-upper(char *s)
  27. {
  28.     int i;
  29.  
  30.     if (isupper) {
  31.         for (i = 0; s[i]; i++)
  32.             s[i] = toupper(s[i]);
  33.     }
  34.     return s;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement