M
mjdeesh_hi
How can we perfom multiplication programatically without using + or *
operator.
Can any one help out in this one.
Jagadeesh.
operator.
Can any one help out in this one.
Jagadeesh.
How can we perfom multiplication programatically without using + or *
operator.
Can any one help out in this one.
How can we perfom multiplication programatically without using + or *
operator.
How can we perfom multiplication programatically without using + or *
operator.
Can any one help out in this one.
#include <stdio.h>
int mult(int a, int b)
{
int c = 0;
while(a--) c -= b;
return -c;
}
Richard said:Ico said:
Very funny.
But I suspect his teacher is trying to get him to find out how computers do
addition and multiplication "under the hood" (because a computer does not
have the luxury of a magic wand we call '*').
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.... snip ...newbie said:Richard Heathfield wrote:
Hehehehehehe!
Totally irrelevent but I thought your magic wand comment was funny
How can we perfom multiplication programatically without using + or *
operator.
Richard Bos said:#include <stdio.h>
int main(void)
{
double m1=4.0, m2=5.0;
printf("%f times %f equals %f.\n", m1, m2, m1/(1.0/m2));
return 0;
}
How can we perfom multiplication programatically without using + or *
operator.
Can any one help out in this one.
Jagadeesh.
For "computer", read "lowest level of computing hardware". That levelRichard said:Ico said:
Very funny.
But I suspect his teacher is trying to get him to find out how computers do
addition and multiplication "under the hood" (because a computer does not
have the luxury of a magic wand we call '*').
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.