You have to THINK anyway, so why not think BIG?
- Donald Trump
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Bit Multiplication
by: suhas
Description:
This is a very simple C++ code sample that shows you how to multiply two integers using bit multiplication.
Code:
main() { unsigned int m,n,i; int prod = 0; printf(\"enter two numbers to multiply\\n\"); scanf(\"%d %d\",&m,&n); for(i = 0; m; m >>= 1,i++) if(m & 01) prod += n << i; printf(\"%d\\n\",prod); }
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
2,652
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
Commission
·
Fat Percentage
·
Grade
·
Gross Pay
·
Hello World
Loans
-
Cheap Car Insurance
-
Mortgages
-
Credit Card Consolidation
"AllSyntax.com" Copyright © 2002-2007; All rights lefted, all lefts righted.
Privacy Policy
|
Internet Rank