Question

Using two for loops write a program to print a multiplication table. Ask the user to input a number between 1 and 10 and print the multiplication table.

10 marks 1) Using two for loops write a program to print a multiplication table. Ask the user to input a number between 1 and


2 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

#to get the input from the user we use input() method.
number = int(input("Please enter a positive integer between 1 and 10:"))
for i in range(1,number+1):
for j in range(1,number+1):
print(i*j," ",end=" ")#to get the multiplication value in same row we use end parameter
print("")#to return to next line

Add a comment
Know the answer?
Add Answer to:
Using two for loops write a program to print a multiplicationtable. Ask the user to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • IN PERL Write a program that will ask the user for a number and will print...

    IN PERL Write a program that will ask the user for a number and will print all the integers in order starting from 1 until the number. Use the <> operator to ask for the user's input. For this program you will write a countdown timer. Your time will count down from 1 minute (60 seconds) to 0. Once the timer gets to 0 seconds the system will display a message that reads: RING RING RING! -using do while-

  • (Using MATLAB) Write a program using loops that will print the following multiplication table: 1 2...

    (Using MATLAB) Write a program using loops that will print the following multiplication table: 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25

  • Write a java program that will print if n numbers that the user will input are...

    Write a java program that will print if n numbers that the user will input are or not within a range of numbers. For that, your program needs to ask first for an integer number called N that will represent the number of times that will ask for other integer numbers. Right after, it should ask for two numbers that will represent the Min and Max for a range. Lastly. it will iterate N number times asking for an integer...

  • In C++ using For Loops; "Write a program that displays number facts for a number provided...

    In C++ using For Loops; "Write a program that displays number facts for a number provided by the end user between 1-100 in a table format that includes the number itself, whether the number is a prime number, whether the number is even or odd, whether the number is a perfect square and all of its factors. " It should also print this information.

  • LABORATORY EXERCISES: Using nested for loops, write a java program to print the pattern as shown...

    LABORATORY EXERCISES: Using nested for loops, write a java program to print the pattern as shown in the sample output. The program does the following: It prompts the user to enter an integer between 1 and 10. It outputs the pattern shown in the sample output based on the user input. Sample output: Enter an integer from 1 to 10: 8 The pattern is: x x x x x x x x x x x x x x x x...

  • To understand the value of counting loops, write a program in C++ that implements matrix multiplication...

    To understand the value of counting loops, write a program in C++ that implements matrix multiplication using counting loop constructs. Let the user input the size/dimensions of the matrix. Then write the same program using only logical loops—for example, while loops.

  • In Java Write a program that will ask the user for integers and print if the...

    In Java Write a program that will ask the user for integers and print if the integer is positive, negative or zero. The program should continue asking for integer until the user enters a negative value.

  • Write a program to print the hollow diamond of stars (*), ask the user to enter...

    Write a program to print the hollow diamond of stars (*), ask the user to enter an odd number as the height. For example, if user enters height as 7, output will look like: Y*

  • The answer need to write in C programming. QUESTION 2 Write a program using array to...

    The answer need to write in C programming. QUESTION 2 Write a program using array to generate a multiplication table based on the user's input. For example if user enter 5 as input then a multiply table for 1 to 5 is printed as output as shown in Figure Q2. There are three main steps in this program which are: Print rows (a) (b) Print columns Print multiplication of data inside table (c) Select C:\example1 \bin\Debuglexample 1.exe enter the value...

  • In Python, write a program that asks the user for a positive integer number. If the...

    In Python, write a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number. For example, if the user enters 10, the output would look something like this. https://www.vectorstock.com/royalty-free-vector/multiplication-table-on-white-background-vector-2721686

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