Advertisement
Josif_tepe

Untitled

Nov 14th, 2022
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6.     int N;
  7.     scanf("%d", &N);
  8.     int parni_cifri = 0;
  9.     while(N > 0) {
  10.         int posledna_cifra = N % 10;
  11.         if(posledna_cifra % 2 == 0) {
  12.             parni_cifri++;
  13.         }
  14.         N /= 10;
  15.     }
  16.     printf("%d\n", parni_cifri);
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement