Answer to Question #21721 in C++ for mohammedsherifelmoushy

Question #21721
write a program that gives you the time table from 1 to 10 of any number the user inputs c++
1
Expert's answer
2013-01-09T08:31:10-0500

#include <iostream>
#include <iomanip>
using namespace std;


// Function prototypes
int getInt (int);
void displayTimeTable (int,int);

int main ()
{

int n;

// Reading data validation
n = getInt (0);
}

int getInt (int k)
{
int n;

do
{

cout << "Enter the rows: ";
cin >> n;
cout << "Enter the column: ";
cin >> n;

if (n > 10)
cout << "Please input a positive integer n that is smaller than
10" <<endl;

} while (n < k);

return n;
}


void displayTimeTable (int i,int n)
{
cout << "*";
for (int n = 1; n <= i; n++)
cout << " " << n;
cout << endl;
cout
<<"----------------------------------------------------------
";
for (int n = 1; n < i; ++n)
{
cout << n;
for (int j = 1; j <= i; j++)
cout << " " << n * j;
cout << endl;
}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS