Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- int main()
- {
- while (true)
- {
- unsigned long long zahl = 0;
- unsigned long long rev = 0;
- printf("Enter number:");
- scanf_s("%lld", &zahl);
- while (zahl > 0) {
- rev <<= 1;
- if ((zahl & 1) == 1) {
- rev ^= 1;
- }
- zahl >>= 1;
- }
- while (rev > 0)
- {
- printf("%d", ((rev & 1) == 1) ? 1 : 0);
- rev >>= 1;
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement