Modify the program so that it uses a void function to display the multiplication
ID: 3534287 • Letter: M
Question
Modify the program so that it uses a void function to display the multiplication table.
#include <iostream>
using namespace std;
int main()
{
//declare variables
int multiplicand =0;
int product =0;
cout << "Multiplicand (negative number to end): ";
cin >> multiplicand;
while (multiplicand >= 0)
{
for (int multiplier =1; multiplier <10;
multiplier += 1)
{
product = multiplicand * multiplier;
cout << multiplicand << " * "
<< multiplier << " = "
<< product << endl;
} //end for
cout << endl;
cout << "Multiplicand (negative number to end): ";
cin >> multiplicand;
} //end while
system ("pause");
return 0;
} //end of main function
Explanation / Answer
http://ideone.com/uIeEgB
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.