Monday, 2 March 2015

C++ Program To Find Multiplication Of Two Number Without Using Asterisk ( * ) Symbol

Problem :- C++ Program To Find Multiplication Of Two Number Without Using Asterisk ( * ) Symbol

here is a definition of above program suppose you want to multiply 20 and 10 there are two method you can follow

Method 1:- 

you can direct multiply 20*10 =200 Or you can follow another method

Method 2:-

you can add 20+20+20+20+20+20+20+20+20+20 =200 means add 20 into 10 times Here i am using 2nd method


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:-

C++ Program To Find Multiplication Of Two Number Without Using Asterisk ( * ) Symbol

No comments:
Write comments

Recommended Posts × +