Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Give a fast way to multiply a number by 7

Answer Posted / rupesh

There is a problem with
x=(x<<3)-x;
Suppose that x is stored in 8 bit format.
If x = 64, i.e. 2^6, then this won't work.
In general, if x is n-bit, and value of x > 2^(n-3), then
this won't work.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using #define to declare a constant?

1095


How important is structure in life?

1029


Is c programming hard?

971


What is the difference between array_name and &array_name?

1240


Describe newline escape sequence with a sample program?

1072


Why we use break in c?

935


State the difference between x3 and x[3].

1052


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1099


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

1130


Why is c still so popular?

1005


What is the newline escape sequence?

1020


Can true be a variable name in c?

986


p*=(++q)++*--p when p=q=1 while(q<=6)

1698


What are different types of pointers?

1012


When is a void pointer used?

1192