Advertisement
Guest User

Untitled

a guest
May 20th, 2019
56
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<string.h>
  3.  
  4. int checkstring_f(char *str)
  5. {
  6.     int i = 0, flag = 0;
  7.  
  8.     for (i = 0; *str != 0; i++, str++)
  9.     {
  10.  
  11.         if (*str >= 'a' && *str <= 'z')
  12.         {
  13.             flag = 1;
  14.  
  15.         }
  16.         if (*str >= 'A' && *str <= 'Z')
  17.         {
  18.             flag = 1;
  19.         }
  20.         if (*str == ' ')
  21.         {
  22.             flag = 1;
  23.         }
  24.     }
  25.  
  26.     return(flag);
  27.  
  28. }
  29. int main(void)
  30. {
  31.  
  32.     char string[10] = { 0 };
  33.     int i;
  34.     printf("enter string \n");
  35.     for (i = 0; i<10; i++)
  36.     {
  37.         *string = getchar();
  38.     }
  39.  
  40.     checkstring_f(string);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement