Strings

Hello everyone, im having problems working on these questions, any help is much-appreciated
Thanks

Q1
Dimension three 4 x 4 matrices. Read from the keyboard sixteen numbers and store them in the first matrix. Calculate the second matrix as the transposed of the first one (the lines of the transposed matrix represent the columns of the original). Add the two matrices and save the result into the third matrix. Print all three matrices. The outputs should be printed in tabular form (the numbers are arranged in four lines and four columns).

Q2
Write a program able to
- define and initialize two strings (your address and your city – do not put a comma at the end of any of these strings)
- concatenate three strings (your address, your city, and a comma between them) to create your full address
- read from the keyboard the name of a city
- perform a loop that compare the name of the entered city with your city and exit the loop only when the result of the comparison is “true” (hint: use strlen() and strncmp() )
- print your full address (one string) in a separate function.


Topic archived. No new replies allowed.