Friday, 9 August 2013

Its just an example of multiplying any number by 2^n-1 or 2^n+1 without using any multiplication symbol.


//multiplication of the number by 2^n+1 2^n-1
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>//will not work in linux
main()
{
      int n=3;
      int m=n<<3;
      printf("%d\n",(m-n));//multiplying 3 by 7
      printf("%d",(m+n));//multiplying 3 by 9
      getch();
      }

No comments:

Post a Comment