# C++ Program To Multiply Two Number Without Using Asterisk

Problem:- Write a C++ program to find multiplication of two number without using Asterisk ( * ) Symbol.

Logic:- There are two methods we can use for solving this problem, this is a very important question for interview purpose because we never think about how we can multiply two number without using Asterisk Sign( * ), we just take two value and use the Asterisk Sign( * ) and put between two variables. We will take an example and through an example, we can try to solve the problem and find out the number of the way we can solve the problem.
For solving a mathematical equation there is a VEDIC Math( Old Indian Math ), By the help of VEDIC Math, we can solve large equation is second for an example if you want to check a Number is divisible by 11 or not How you can check in a second and remember number may be very large. For an example, we take a number 161051 is divisible by 11 or not. you can check the demo of VEDIC math, C Program To Check Number Is Divisible By 11 Or Not Using (VEDIC MATH).

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.

You can direct multiple 20 * 10 = 200 this is a very famous  Traditional way for calculating or solving multiplication but here one problem occurring in problem statement specially mention that you can not use an Asterisk Sign(*) So you have to Follow another method.

Method 2:-

So here we go we know that multiplication is an addition of one number to another number of (First / Second) number of times. Don't get you 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 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. Here i am using method 2.

Solution:-

#include<iostream>
using namespace std;
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<<"Result are : "<<temp<<endl;
}

Output:-

Previous Post
Next Post

#### post written by: Ghanendra Yadav

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.