Advertisement
Josif_tepe

Untitled

Jan 16th, 2024
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4. int main() {
  5.     char s[1000];
  6.     scanf("%s", s);
  7.  
  8.     for(int i = 0; i < strlen(s); i++) {
  9.         if(isalpha(s[i])) {
  10.             printf("Karaktarot %c e del alphabetical\n", s[i]);
  11.         }
  12.         if(isdigit(s[i])) {
  13.             printf("Karakterot %c e cifra\n", s[i]);
  14.         }
  15.         if(isalnum(s[i])) {
  16.            printf("Karakterot %c e ili bukva ili cifra\n", s[i]);
  17.         }
  18.         if(isspace(s[i])) {
  19.             printf("Karakterot empty space\n");
  20.         }
  21.         if(!isspace(s[i]) && !isalnum(s[i])) {
  22.             printf("Karakterot %c e specijalen karakter\n", s[i]);
  23.         }
  24.     }
  25.     return 0;
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement