Question

The answer need to write in C programming.

QUESTION 2 Write a program using array to generate a multiplication table based on the users input. For example if user ente

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

#include <stdio.h> 1 clang version 7.0.0-3-ubuntu0.18.04.1 (tags/REL 2 inal) clang-7 -pthread -lm -o main main.c > ./main voi

#include <stdio.h>

void printMul(int a, int b)

{

printf("%4d", a*b);

}

void rowsAndColumns(int n)

{

int i, j;

printf(" *|");

for( i = 1; i<=10; i++)

printf("%4d", i);

printf("\n---");

for( i = 1; i<=10; i++)

printf("----");

for( i = 1; i<=n; i++)

{

printf("\n%2d|", i);

for(j=1; j<=10; j++)

printMul(i, j);

}

}

int main(void) {

int n = 5;

printf("Enter the value: ");

scanf("%d", &n);

rowsAndColumns(n);

return 0;

}

// Hit the thumbs up if you are fine with the answer. Happy Learning!

Add a comment
Know the answer?
Add Answer to:
The answer need to write in C programming. QUESTION 2 Write a program using array to...
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
  • 1. Write a C++ program to compute the Binomial Coefficient to construct a 2D array using...

    1. Write a C++ program to compute the Binomial Coefficient to construct a 2D array using two input parameters: n and k Then once the table is constructed Display the entire table according to rows and columns. Give user a choice of computing the Binomial coefficient at various values of n and k using this table,i.e. prompt the user to enter a value of i and j (i <= n and j <= k), code first test if the input...

  • Need some help I am not understanding this programming class at all. We are using Microsoft...

    Need some help I am not understanding this programming class at all. We are using Microsoft visual studio with python in console mode to complete these labs. Double-click to hide white space CIS115 Week 4 Lab Overview Title of Lab: Multiplication Table in Python Summary This week's lab is to create a simple multiplication table using nested loops and if statements. Prompt the user for the size of the multiplication table (from 2x2 to 10x10). Use a validation loop to...

  • (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

  • in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample...

    in Java programming Using IF statement, write a program that prints multiplication table for 1-10. Sample Program Output. 1     2     3     4     5     6     7     8     9     10       1     1     2     3     4     5     6     7     8     9     10       2     2     4     6     8     10    12    14    16    18    20       3     3     6     9     12    15    18    21    24    27    30       4     4     8     12    16    20    24    28    32    36    40       5     5     10   ...

  • This program is C++ You have just been offered your first big software contract. The scope...

    This program is C++ You have just been offered your first big software contract. The scope of work is to create a tool for grade school students to learn their times tables. In this program, you will create a 10 x 10 grid of times tables as a cheat sheet for the students to learn. This will display the values of the times tables all the way from 1x1 to 10x10. Make use of formatting tools like inserting tabs, setwidth(),...

  • In C++ The Multiplication Program Step 1: Write a program that stores a multiplication table in...

    In C++ The Multiplication Program Step 1: Write a program that stores a multiplication table in a 9-by-9 two-dimensional array. Generate the multiplication table with two loops. (So you will have a nested loop that will iterate 9 times and fill the 9x9 array with the values.) Step 2: Display the table for the user to see it. a 9x9 table Step 3: Create a function that returns the product of two numbers between 1 and 9by looking up the...

  • in c++ using repl.it only Problem 3 : C++, using repl.it for coding ONLY answer, but...

    in c++ using repl.it only Problem 3 : C++, using repl.it for coding ONLY answer, but sure leave to leave comments every two lines explaining what the codes mean as you go along (a) Write program that prompts the user to enter the number of columns and rows in a grid. The program should print out a seating chart with the desired grid dimensions. The seating chart should be numbered starting at 1 in the top left corner. Codecheck How...

  • Choose 3 of 5 Problems to Solve Need Soon as possible Choose 3 of5 Problems to...

    Choose 3 of 5 Problems to Solve Need Soon as possible Choose 3 of5 Problems to Solve (20 Point/Each) Problem l: Triangle Printing Program: Write an application that prints a right triangle with 1 to 8 rows. Prompt the user to enter an odd number in the range of 1 to 8 to specify the number of rows in the diamond. Add a validation loop to ensure the user does not enter an even number or a number outside the...

  • /*************************************************** Name: Date: Homework #7 Program name: HexUtilitySOLUTION Program description: Accepts hexadecimal numbers as input. Valid...

    /*************************************************** Name: Date: Homework #7 Program name: HexUtilitySOLUTION Program description: Accepts hexadecimal numbers as input. Valid input examples: F00D, 000a, 1010, FFFF, Goodbye, BYE Enter BYE (case insensitive) to exit the program. ****************************************************/ import java.util.Scanner; public class HexUtilitySOLUTION { public static void main(String[] args) { // Maximum length of input string final byte INPUT_LENGTH = 4; String userInput = ""; // Initialize to null string Scanner input = new Scanner(System.in); // Process the inputs until BYE is entered do {...

  • Using java E6.17 Write a program that prints a multiplication table, like this: 1 2 3...

    Using java E6.17 Write a program that prints a multiplication table, like this: 1 2 3 4 56 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 10 20 30 40 50 60 70 80 90 100

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