answersLogoWhite

0

Here is the code...

#include<stdio.h>

void main()

{

int a,b,c;

printf("Enter 2 numbers to multiply (smaller first): ");

scanf("%d %d",&a,&b);

c=0;

while(b!=0)

{

if(b&1!=0)c+=a;

b=b>>1;

a=a<<1;

}

printf("The product is %d",c);

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is precedence between relational operator and arithmetic operator?

Arithmetic operators (+, -, *, /, % ) have greater precedence over relational operators (&lt;, &gt;, &lt;=, &gt;=, ==, !=) in C language.


Why a friend function cannot be used to overload the assignment operator?

Assignment(=) operator is a special operator that will be provided by the constructor to the class when programmer has not provided(overloaded) as member of the class.(like copy constructor). When programmer is overloading = operator using friend function, two = operations will exists: 1) compiler is providing = operator 2) programmer is providing(overloading) = operator by friend function. Then simply ambiguity will be created and compiler will gives error. Its compilation error.


C program to implement arithmetic assignment operator?

y=2x2+3x+1


How operator overloading differ from function overloading?

Function overloading is multiple definition with different signatures(the parameters should be different) for the same function. The parameter list have to be different in each definition. The compiler will not accept if the return type alone is changed. Operator overloading is defining a function for a particular operator. The operator loading function can not be overloaded through function overloading.


What is difference between conditional operator and bitwise operator?

A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.

Related Questions

What is an arithmetic operator in c?

+


Arithmetic operator that divides contents of a cell?

The arithmetic operator that divides contents of a cell is the front slash. =A3/B3


What is an arithmetic operator that multiplies?

Multiplication


What arithmetic operator multiplies by 0.01?

percentage


Arithmetic operator that multiplies by 0.01?

percentage


What is an arithmetic operator in c program?

An arithmetic operator is any of the "atomic" operators to do the following math operations: + addition - subtraction / division * multiplication % modulus division


Arithmetic operator that makes a number negative?

Negation


What arithmetic operator performs division?

forward slash /


In excel what is the arithmetic operator that multiplies by 0.01?

percent


What does the arithmetic operator do in Excel?

The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)The following are valid Excel operations for arithmetic in Excel:+ (plus)- (minus)/ (divide)* (multiply)^ (power of)


What is the arithmetic operator that adds contents of cells?

the plus sign (+)


What is the arithmetic operator that adds contents to cells?

the plus sign (+)