Sample program (multiplication using addition)
by Nideesh C on February 8, 2011 · 2 comments
in C++
#include <iostream.h>
int mult (int x, int y) {
int result;
result = 0;
while (y != 0) {
result = result + x;
y = y – 1;
}
return(result);
}
int main () {
int x, y;
cout << “Enter two natural numbers: “;
cin >> x >> y;
cout << x << ” * ” << y << ” = ” << mult(x,y) << endl;
return(0);
}
Not Satisfied ? Just search & get the result
No related posts.
Tagged as:
c programming examples,
c programming reference,
c tutorial,
C++,
c++ program examples,
C++ Programming,
learning c++,
multiplication using addition,
programming languages,
programming languages c,
sample c++ programs
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.
{ 2 comments… read them below or add one }
I need more multiplication by addition programming in another way
Sample program (multiplication using addition)