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
  • please use c++ language 1. Request three different integers from the console. a) Write a swap...

    please use c++ language 1. Request three different integers from the console. a) Write a swap function that swaps two integer values. b) Write a sort function which accepts three integers as input then sorts them from largest to smallest using the swap function. c) Output the integers before and after sorting. Example 1 Output (input in bold italics) Enter three different integers: 3 2 4 3 2 4 4 3 2 Example 2 Output (input in bold italics) Enter...

  • 1. Request a 3-digit integer from the console. Use division and modulo operations to extract each...

    1. Request a 3-digit integer from the console. Use division and modulo operations to extract each digit in reverse order. For each digit, determine if it is a factor of the original integer. Example Output (input in bold italics) Enter a 3-digit integer: 543 Is 3 a factor of 543? 1 Is 4 a factor of 543? 0 Is 5 a factor of 543? 0 c++ language

  • use Quincy Write a program to generate the multiplication table of an integer number (entered by...

    use Quincy Write a program to generate the multiplication table of an integer number (entered by the user) using for loop. You should only use the main() function. Sample output Enter an integer: 9 9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81 9*10=90

  • C++ 3. Write a program that recursively calculates n factorial (n!) a) Main should handle all...

    C++ 3. Write a program that recursively calculates n factorial (n!) a) Main should handle all input and output b) Create a function that accepts a number n and returns n factorial c) Demonstrate the function with sample input from console. n! n * n-1 * n-2 * n-3, for all n > 0 For example, 3!-3 21-6 using a recursive process to do so. Example output (input in bold italics) Enter a number: 5 5120

  • Write a program that prints out multiplication table: 1. In the main loop, it should ask...

    Write a program that prints out multiplication table: 1. In the main loop, it should ask a user to enter a number in the range of 1 to 12. Exit the program upon input out of range (eg., 0 or 13). 2. Output the multiplication table from 1 to 12. Possible output: Enter the number (1-12): 9 9 * 1 = 9 9 * 2 = 18 9 * 3 = 27 9 * 4 = 36 9 * 5...

  • Write a program in Python that accepts as input an integer N and a real number...

    Write a program in Python that accepts as input an integer N and a real number c, and outputs the coefficient of the Nth degree term of the Taylor series for the function f(x) = ex centered at c. This process should recur until the user enters a quit code. Erroneous input should be excepted as necessary, and should result in a new prompt.

  • Write in C++ program Larger than n In a program, write a function that accepts three...

    Write in C++ program Larger than n In a program, write a function that accepts three arguments: an array, the size of the array, and a number n. Assume the array contains integers. The function should display all of the numbers in the array that are greater than the number n. Input from the keyboard: The filename and path of a list of integer numbers.                                           The number n to test the file numbers. Output to the console: The...

  • In Java: Get an integer n from an input dialog or the console window (with user...

    In Java: Get an integer n from an input dialog or the console window (with user input), print out the following pattern on the console window (you may refer to displaying number-pyramid example shown in class). For example, when n is 3, there are 5 rows in total.               * ***            *****              ***                * When n is 4, there are 7 rows in total.               *             ***           *****         *******           *****             ***

  • Write a method called Drawline that accepts as input an integer n and generates a line...

    Write a method called Drawline that accepts as input an integer n and generates a line of output in lstOutput with n hyphens. That is, if n = 6 we have a line of ‘------‘ displayed in the list box. Must be in C#

  • Write a MARIE assembly program that accepts one integer input. Use the the number to calculate...

    Write a MARIE assembly program that accepts one integer input. Use the the number to calculate the factorial. You must use addition not multiplication. Example: 5! = 5x4x3x2x1 Print out the result.

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