Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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

image text in transcribed

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 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago