Advertisement
sellmmaahh

OR-Skripta-Zad36.

Aug 12th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int IzbaciP (int n) {
  5.     int nb=0, k=1, cifra;
  6.     while (n!=0)  {
  7.             cifra=n%10;
  8.       if (cifra%2!=0) { nb+=k*cifra;
  9.       k*=10;
  10.       }
  11.       n/=10;
  12.     }
  13.     return nb;
  14. }
  15. int main () {
  16.     printf("%d",IzbaciP(1234567));
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement