Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void PuteriDoi(int n) {
- int x;
- if (n != 0) {
- x = n & (n - 1);
- printf("%d ", n - x);
- PuteriDoi(x);
- }
- }
- int main() {
- int n;
- printf("n= "); scanf("%d", &n);
- PuteriDoi(n);
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment