Skip to content

Instantly share code, notes, and snippets.

@Ch-sriram
Last active May 29, 2020 12:12
Show Gist options
  • Save Ch-sriram/2812981bba250d52e75d34d4db50e294 to your computer and use it in GitHub Desktop.
Save Ch-sriram/2812981bba250d52e75d34d4db50e294 to your computer and use it in GitHub Desktop.
Given a number N, find 2^N.
// Only works for 64 bit integers
int64_t pow2 (long long N) {
if (N==0) return 1;
return 1LL << N;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment