60 478
Assignments Done
98,1%
Successfully Done
In April 2018

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++
Expert's answer

#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions