Skip to content

Instantly share code, notes, and snippets.

@Ch-sriram
Created May 28, 2020 14:16
Given Xth & Yth bit positions, WAF to create a number where Xth & Yth bit are set.
int setxy (int x, int y) {
return ((1 << x) | (1 << y));
}
@Saivardhan-123
Copy link

what if the 0 <= x,y <= 10^5 it may overflow

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment