Advertisement
Josif_tepe

Untitled

Aug 20th, 2023
839
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, const char * argv[]) {
  4.  
  5.     int n;
  6.     scanf("%d", &n);
  7.    
  8.     int zbir = 0;
  9.     while(n > 0) {
  10.         int cifra = n % 10;
  11.        
  12.         if(cifra % 2 == 0) {
  13.             zbir += cifra;
  14.             printf("%d ", cifra);
  15.         }
  16.         n /= 10;
  17.        
  18.     }
  19.     return 0;
  20. }
  21.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement