Created
May 28, 2020 14:16
Given Xth & Yth bit positions, WAF to create a number where Xth & Yth bit are set.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int setxy (int x, int y) { | |
return ((1 << x) | (1 << y)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what if the 0 <= x,y <= 10^5 it may overflow