Search This Blog

Translate

Write a function to find x rise to y using bit wise operators

Write a function to find x rise to y using bit wise operators.

Write a program to calculate pow(x,y)
Function to calculate x raised to the power y in
This program takes two integers from user ( base number and a exponent) and calculates answer

MCA c programming exam 2013-2014, 

how to Write a function to find x rise to y using bit wise operators,

c program to find square, cube using bit wise operator source code with example

Write a function to find x rise to y using bit wise operators.


int pow(int x, int y)
{
            int a,b,c=1;
            while(y)
            {
                        if(y & 1)
                                    c *= x;
                        y = y >> 1;
                        x *= x;
            }
            return c;
}

C Program example List

Google+ Badge