Now come to the problem there is two way, So let's take an example suppose we want to multiply 20 and 10 there are two methods you can follow. Let's find out how to multiply without using * Operator.
You can direct multiple 20 * 10 = 200 this is a very famous Traditional way for calculating or solving multiplication but here one problem occurs in the problem statement specially mentioning that you can not use an Asterisk Sign (*) So you have to Follow another method.
So here we go we know that multiplication is an addition of one number to another number of (First / Second) times. Don't get you to let's take an example we want to multiply 20 * 10 so we can add 20 into 10 times like 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 = 200 or we can add 10 into 20 times the answer will be same like 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 = 200.
Multiply Two Numbers Without Using Multiplication Operator in C++
#include <iostream>
using namespace std;
/*Multiply Two Numbers Without Asterisk*/
int main()
{
long a, b, i, temp = 0;
cout << "Enter Two numbers for multiplication : \n";
cin >> a >> b;
for (i = 1; i <= b; i++)
{
temp = temp + a;
}
cout << endl << "Multplication of Two Numbers Without Asterisk: " << temp << endl;
}
Method 1: Multiply Two Numbers
You can direct multiple 20 * 10 = 200 this is a very famous Traditional way for calculating or solving multiplication but here one problem occurs in the problem statement specially mentioning that you can not use an Asterisk Sign (*) So you have to Follow another method.
Method 2: Multiply 2 Numbers Without Using * Operators
So here we go we know that multiplication is an addition of one number to another number of (First / Second) times. Don't get you to let's take an example we want to multiply 20 * 10 so we can add 20 into 10 times like 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 = 200 or we can add 10 into 20 times the answer will be same like 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 = 200.
For solving a mathematical equation there is VEDIC Math(Old Indian Math). If you want to check whether a Number is divisible by 11 or not, you can check in a second. We can take the number 161051 to be divisible by 11 or not. you can check the demo of VEDIC math,
0 Comments: