Horje
pow without math.h Code Example
pow without math.h
int pow(int base, int exp)
    {
      if(exp < 0)
        return -1;

        int result = 1;
        while (exp)
        {
            if (exp & 1)
                result *= base;
            exp >>= 1;
            base *= base;
        }

        return result;
    }




Cpp

Related
C++ Syntax Code Example C++ Syntax Code Example
how to take input in 2d vector in c++ Code Example how to take input in 2d vector in c++ Code Example
what is the meaning of life and everything in the universe Code Example what is the meaning of life and everything in the universe Code Example
c++ length of int Code Example c++ length of int Code Example
output to console in color c++ Code Example output to console in color c++ Code Example

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