How to write a C program to find the power of 2 in a normal way and in single step?
How to write a C program to find the power of 2 in a normal way and in single step?
#include<math.h>
pow(2,i); // 2 raise to i......i can have any value
1<<n;
/* above statement is equal to 2 power n; you can change value of n to any value.
But keep in mind that this statement abilities are restricted by the size of integer.
So you can't try with too big value for n */
Thanks,
Krishna
1<<n dude this statement is not working.....
There are currently 1 users browsing this thread. (0 members and 1 guests)