#include<stdio.h>
void main()
{
int a,b,result;
printf("Enter the numbers to be multiplied :\n");
scanf("%d%d",&a,&b);
result=0;
while(b != 0)
{
if (b&0x01)
{
result=result+a;
}
a<<=1;
b>>=1;
}
printf("Result:%d",result);
}
void main()
{
int a,b,result;
printf("Enter the numbers to be multiplied :\n");
scanf("%d%d",&a,&b);
result=0;
while(b != 0)
{
if (b&0x01)
{
result=result+a;
}
a<<=1;
b>>=1;
}
printf("Result:%d",result);
}
No comments:
Post a Comment