---
# System prepended metadata

title: 11138 - Binary addition
tags: [bitwise]

---

# 11138 - Binary addition
>author: Utin
###### tags: `bitwise`
---

## Brief
See the code below

## Solution 0

```c=
#include <stdio.h>

void output(int tmp) {
    if (!tmp) return;
    output(tmp / 2);
    printf("%d", tmp % 2);
}

int main() {
    int n, ans = 0;
    scanf("%d", &n);
    output(n + 1);
    printf(" ");
    while ((1 << ans) & n) ans++;
    printf("%d\n", ans);
}

// Utin
```

## Reference