subject

In this assignment, you will do a number of C programming exercises. Matrix multiplication (matrixmul. c):Given an n x k matrix A and an k x m matrix B, with 1≤n, m,k≤300, write a C program that computes the matrix product C=AB. All entries in matrices A and B are integers with abolute value less than 1000, so you don't need to worry about overflow. If matrices A and B do not have the right dimensions to be multiplied, the product matrix C should have its number of rows and columns both set to zero. Input/Output: please use scanf and printf to handle the data input and output. Input format:Line 1: Two space-separated integers, n and k. Line 2 to n+1: line i+1 contains k space-separated integers: row i of matrix A. Line n+2: Two space-separated integers, k and m. Line n+3 to n+k+4: Line i+n+3 contains m space-separated integers: row i of matrix B. Sample Input:3 21 11 2-4 02 31 2 13 2 1Output format:Line 1: two space-separated n and m, the dimension of matrix C. Line 2 to m+1: Line i+1 contains m space-separated integers: row i of matrix C. Sample Output:3 34 4 27 6 3-4 -8 -4Transposition Cipher (encrypt. c):A very simple transposition cipher encrypt(S) can be described by the following rule:If the length of S is 1 or 2, then encrypt(S) is S. If S is a string of N characters s1 s2...sN and k=⌊N/2⌋, thenenc(S)=encrypt(sksk-1...s2s1)+e ncrypt(sNsN-1...sk+1)where + indicates string cancatenation. For example, encrypt("OK")="OK" and encrypt("12345678")="34127856".Writ e a program to implement this cipher, given an arbitary text string from keyboard, up to 8192 characters. It's better to write a separate encryption function, similar to the following:char* encrypt(char *string, size_t length) { // you fill this out}Input Format:an abitary string (with the length up to 8192 characters).Sample Input:Test early and often!Output FormatLine 1: One integer: the toal number of characters in the string. Line 2: The enciphered string. Sample Output:21aeyrleT sttf!enn aodIII. Submission:Each student submits one copy of the source code: matrixmul. c and encrypt. c.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:50
Is one of the most injurious events that can happen to a person in a crash.
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
You know the right answer?
In this assignment, you will do a number of C programming exercises. Matrix multiplication (matrixmu...
Questions
question
Biology, 29.03.2021 19:10
question
Mathematics, 29.03.2021 19:10
question
Spanish, 29.03.2021 19:10
question
Mathematics, 29.03.2021 19:10
question
Computers and Technology, 29.03.2021 19:10
question
Mathematics, 29.03.2021 19:10
Questions on the website: 13722361