Adsense 728 * 15

Search

Custom Search

Program to Multiply two numbers without using (*) Multiplication Operator

Write a C, C++ Program to multiply two numbers without using (*) multiplication operator.


Program to subtract two numbers without using subtraction operator.

 Add two numbers without using addition operator.


Program to multiply two numbers without using (*) multiplication operator


#include <iostream>

using namespace std;

int main() {

   int fnum,snum,mult=0,i;

   
   /* Input two numbers from user. */
   
   cout<<"Enter two numbers";
   cin>>fnum>>snum;
   
   
   /* Add the number using loop. */

   for(i=0;i<fnum;i++){
    
      mult = mult + snum;
   }
   
    cout<<"Multiplication of two numbers is "<<mult;
    
 return 0;
}


Output:

 Enter two numbers : 4
3

Multiplication of two numbers is 12

No comments:

Post a Comment