View Single Post
Old 27-03-08, 01:30 PM   #4 (permalink)
sk_kireeti
Super Moderator
 
sk_kireeti's Avatar
 
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,355
Thanks: 117
Thanked 255 Times in 206 Posts
Thanks: 117
Thanked 255 Times in 206 Posts
Blog Entries: 4
Rep Power: 53 sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute
Re: C language - How to write a C program to find the power of 2 in a normal way and in single step?

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
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation.
sk_kireeti is offline   Reply With Quote