FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Challenging Problems for Placements

 


Shirish
Post your problems on programming asked in placement tests and interviews and they will be solved jointly

Last edited by Shirish on Fri Apr 14, 2006 3:56 pm; edited 1 time in total
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

Job that u wouldn't mind doing for the rest of your life
Facing Many Problems
New forum area (computer problems)
Problems With Index Page
FTP problems --> Use Filezilla and/or active mode

problems
Linux or Windows on your computer?!
CSS layout help
Problems with provider
Host Problems

Laptop Bootup Problems...
do u scare exam?
Gmail Problems
Audio problems
NY Times: A perfect example of lieberals spreading...
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-2007 Frihost, forums powered by phpBB.