Question
I need to format a multiplication table in C++ to look like the one below (for 4x4 table) But I can't get the right formating
I need to format a multiplication table in C++ to look like the one below (for 4x4 table)
But I can't get the right formating with the program I wrote. What I have is
#include
#include
using namespace std;
int main()
{
char choice;
int tableSize, row, coll;
do
{
cout
cin >> choice;
if (choice == 'a')
{
do
{
cout
cin >> tableSize;
if (tableSize 10)
{
cout
}
} while(tableSize 10)
cout
for(coll = 1; coll
{
cout
for(row = 1; row
{
cout
for(coll = 1; coll
{
cout
}
}
}
}
else if (choice != 'q')
{
cout
}
else
{
return 0;
}
} while(choice != 'q');
return 0;
}
Can someone please say what I need to change or add in order to get the right format. And the output I get is
MULTIPLICATION TABLE 4' s 1 I 1 I 2 l 3 I 4 I 2 l 2 l 6 l 8 I 4 I 3 I 3 I 6 l 9 12 I 8 l 12 l 16 4 I 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started