Question

Request an integer n from the console. Write a function that accepts n as input and...

Request an integer n from the console. Write a function that accepts n as input and
outputs the multiplication table of n from 1 to n to the console.
Example Output (input in bold italics)
Enter an integer: 9
1 * 9 = 9
2 * 9 = 18
3 * 9 = 27
4 * 9 = 36
5 * 9 = 45
6 * 9 = 54
7 * 9 = 63
8 * 9 = 72
9 * 9 = 81

it's a c++ programming.please write on atom software.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

void printTable(int n){
   for(int i = 1;i<=n;i++){
      cout<<i<<" * "<<n<<" = "<<(i*n)<<endl;
   }
}

int main(){
   int n;
   
   cout<<"Enter an integer: ";
   cin>>n;
   
   printTable(n);
   
   return 0;
}
Add a comment
Know the answer?
Add Answer to:
Request an integer n from the console. Write a function that accepts n as input and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT