Horje
powers of 2 in cpp Code Example
powers of 2 in cpp
// If not using any extra libraries
// Powers of 2. If finding 2^n
int main() {
  int ans = 1 >> n;
}
// Suppose we want to find x ^ y
void power(int x, int y) {
  int ans = 1;
  for (int i = 0; i < y; i++) {
    ans *= x;
  }
  return ans;
}




Cpp

Related
cin c++ Code Example cin c++ Code Example
get map values c++ Code Example get map values c++ Code Example
convert char or string to int or double Code Example convert char or string to int or double Code Example
substring function in c++ Code Example substring function in c++ Code Example
how to empty an array c++ Code Example how to empty an array c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8