C++ program to multiply two numbers without using multiplication operator

Write a c++ program to multiply two numbers without using multiplication operator.

#include<iostream.h>
#include<conio.h>
void main ()
{
int a,b,i,temp=0;
clrscr();
cout<<"Enter Two numbers for multiplication";
cin>>a>>b;
for(i=1;i<=b;i++)
{
temp=temp+a;
}
cout<<endl<<"Result are:: "<<temp;
getch();
}
Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

18 thoughts on “C++ program to multiply two numbers without using multiplication operator

  1. Hi,
    just update the For loop condition
    #include
    #include
    void main ()
    {
    int a,b,i,temp=0;
    clrscr();
    cout<>a>>b;
    for(i=1;i<b;i++)
    {
    temp=temp+a;
    }
    cout<<endl<<"Result are:: "<<temp;
    getch();
    }

  2. also
    for(i=0;i<=a;i+)
    {
    for(j=0;j<=b;j++)
    {
    count++;
    }
    }
    printf("%d",count);

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in