Question

In: Computer Science

Write a function such that given a number N, display the N*N multiplication matrix from 1...

Write a function such that given a number N, display the N*N multiplication matrix from
1 to N. Then, write a C++ program such that, it prints the multiplication matrices of
numbers 1,4,7, and 10 using a loop concept.
Check the sample output below, to see how the program should work. Make sure to have
your output exactly the same as the below output.

Solutions

Expert Solution

here is no given sample output..

C++ code..

#include<iostream>
using namespace std;
int main()
{
int i,j,n;
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
cout<<i*j<<" ";
}
cout<<endl;
}
}

if any change in output or code.. comment below


Related Solutions

Implement function matmul() that embodies multiplication of n*n matrix in c language?(code) Can you let me...
Implement function matmul() that embodies multiplication of n*n matrix in c language?(code) Can you let me know?
Java Program Use for loop 1.) Write a program to display the multiplication table of a...
Java Program Use for loop 1.) Write a program to display the multiplication table of a given integer. Multiplier and number of terms (multiplicand) must be user's input. Sample output: Enter the Multiplier: 5 Enter the number of terms: 3 5x0=0 5x1=5 5x2=10 5x3=15 2 Create a program that will allow the user to input an integer and display the sum of squares from 1 to n. Example, the sum of squares for 10 is as follows: (do not use...
Write a recursive function to calculate and return factorial of a given number 'n'. in C...
Write a recursive function to calculate and return factorial of a given number 'n'. in C progrmaining
Need to write a code using c# Strassen’s Algorithm for matrix multiplication.
Need to write a code using c# Strassen’s Algorithm for matrix multiplication.
(1) Write a simple Lisp function factorial1 to computee factorial number of n recursivaly (where n...
(1) Write a simple Lisp function factorial1 to computee factorial number of n recursivaly (where n is an int >= 0). (2) Write a Lisp function factorial2 to computee factorial number of n (where n is an int >=0) recursivaly with a global variable (e.g., a list, an array, or a hash tble) to save the result to be used later (memorization) to compute next factorial number. Run the program with test case. For your test run, the following cases:...
Write a Matlab function for a matrix that takes in a matrix in echelon form and...
Write a Matlab function for a matrix that takes in a matrix in echelon form and will return the row canonical form. The function cannot use rref, or any other matlab built in functions.
Matlab script that uses loops to create a multiplication table (matrix) where the user enters 'n'...
Matlab script that uses loops to create a multiplication table (matrix) where the user enters 'n' (nxn chart).
Write a program that accept an integer input from the user and display the least number...
Write a program that accept an integer input from the user and display the least number of combinations of 500s, 100s, 50s, 20s, 10s, 5s, and 1s. Test your solution using this samples] a. Input: 250 Output: 1x200s, 1x50s b. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s c. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s d. Input: 19 Output: 1x10s, 1x5s, 4x1s ​[Hints] o Use division to determine the number of occurrence of each element (i.e. 200, 100)...
Given two 2x2 matrices: M=1     21     1,N=-1       2     1   -1 (a).Verify multiplication of M x N...
Given two 2x2 matrices: M=1     21     1,N=-1       2     1   -1 (a).Verify multiplication of M x N mod 26 = N x M mod 26 = I (identity matrix) (b). Use Hill cipher to encrypt the message EXAMS
Write a function sum_int( n ) to compute the sum of the integers from 1 up...
Write a function sum_int( n ) to compute the sum of the integers from 1 up to and including n.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT