Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int IzbaciP (int n) {
- int nb=0, k=1, cifra;
- while (n!=0) {
- cifra=n%10;
- if (cifra%2!=0) { nb+=k*cifra;
- k*=10;
- }
- n/=10;
- }
- return nb;
- }
- int main () {
- printf("%d",IzbaciP(1234567));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement