Skip to content

Instantly share code, notes, and snippets.

@Ch-sriram
Created May 28, 2020 14:16
Show Gist options
  • Save Ch-sriram/9171a1a9dad728d37eb95f3f185dfa4f to your computer and use it in GitHub Desktop.
Save Ch-sriram/9171a1a9dad728d37eb95f3f185dfa4f to your computer and use it in GitHub Desktop.
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));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment