Multiply Two Numbers Without Using Multiply Operator
========================================================================
#include<iostream>
using namespace std;
main()
{
int num1,num2;
int mul=0;
cout<<"Enter Two Numbers to Multiply\n";
cin>>num1>>num2;
for(int i=0;i<num1;i++)
{
mul=mul+num2;
}
cout<<mul;
}
========================================================================
#include
ReplyDeleteusing namespace std;
main()
{
int num1,num2;
int mul=0;
cout<<"Enter Two Numbers to Multiply\n";
cin>>num1>>num2;
for(int i=0;i<num1;i++)
{
mul=mul+num2;
}
cout<<mul;
}