FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Challenging Problems for Placements





Shirish
Post your problems on programming asked in placement tests and interviews and they will be solved jointly
Shirish
/*********************************************************
Program to find whether a number is power of 2
like 2, 4, 8, 16, 32, , without using division operator
Author : Shirish Goyal
*********************************************************/
#include <iostream.h>

int main()
{
long int a;
cout<<"Input a number ? ";
cin>>a;
cout<<endl<<a<<(((a & (a-1))==0)?" is":" is not")<<" a power of 2";
return 0;
}
Animal
This is spamming. You have already been warned about multiple-posting too. Please do not post any more topics like this.

If you want to share your programming knowledge, please use the Tutorials forum, but only if you are making a specific point.

-close-
Related topics
Facing Many Problems
New forum area (computer problems)
Linux or Windows on your computer?!
Problems With Index Page
FTP problems --> Use Filezilla and/or active mode
problems
CSS layout help
do u scare exam?
Problems with provider
Host Problems
Laptop Bootup Problems...
Gmail Problems
Audio problems
Job that u wouldn't mind doing for the rest of your life
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.