Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ac8cc1c

Browse files
Add files via upload
1 parent e2bf55a commit ac8cc1c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdio.h>
2+
3+
#define MASK_ALL_1s 0xFFFFFFFF
4+
5+
int main()
6+
{
7+
unsigned int current_number, flipped_number;
8+
scanf("%u", &current_number);
9+
10+
//Flips all the 1s to 0s and all the 0s to 1s.
11+
flipped_number = current_number^MASK_ALL_1s;
12+
13+
printf("%u\n",flipped_number);
14+
return 0;
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /