| | |
Solve me
![]() |
•
•
Join Date: Nov 2005
Posts: 5
Reputation:
Solved Threads: 0
[U]Problem Statement:
Write a program that adds two matrices A and B of order 2X4 and store the result in third matrix C and C is stored in a file “result.txt�. The program should take the values from the user in the matrices through a function input. The addition of the Matrices should be calculated through a function add. The resultant matrix should be written in the file through a function save. Also display the result in a good looking format on the screen in a function show() .
Design and Implementation:
You are required to make three functions named as:
input()
This function will read values in the two Matrices.
add()
This function will take the two Matrices as arguments and add them and the result will be stored in a third matrix.
save()
This function will take the resultant matrix as argument and saves it to a file.
show()
This function will display the resultant matrix on the screen.
Hint 1: A two dimensional array is known as matrix in mathematics.
Hint 2: show() and save() should be called from add() respectively.
Sample output:
The following prototypes for the respective functions can be used to implement the above mentioned problem:
void input();
void Add( int arr1[][] , int arr2[][] );
void show( int array3[][] );
void save( int arr3[][] );
Your output can be similar with the following:
Enter values for first A:
2
3
1
1
5
3
2
4
Enter values for B:
4
2
3
1
8
9
1
4
Matrix C is:
6 5 4 2
13 12 3 8[/i] :eek:
Write a program that adds two matrices A and B of order 2X4 and store the result in third matrix C and C is stored in a file “result.txt�. The program should take the values from the user in the matrices through a function input. The addition of the Matrices should be calculated through a function add. The resultant matrix should be written in the file through a function save. Also display the result in a good looking format on the screen in a function show() .
Design and Implementation:
You are required to make three functions named as:
input()
This function will read values in the two Matrices.
add()
This function will take the two Matrices as arguments and add them and the result will be stored in a third matrix.
save()
This function will take the resultant matrix as argument and saves it to a file.
show()
This function will display the resultant matrix on the screen.
Hint 1: A two dimensional array is known as matrix in mathematics.
Hint 2: show() and save() should be called from add() respectively.
Sample output:
The following prototypes for the respective functions can be used to implement the above mentioned problem:
void input();
void Add( int arr1[][] , int arr2[][] );
void show( int array3[][] );
void save( int arr3[][] );
Your output can be similar with the following:
Enter values for first A:
2
3
1
1
5
3
2
4
Enter values for B:
4
2
3
1
8
9
1
4
Matrix C is:
6 5 4 2
13 12 3 8[/i] :eek:
![]() |
Similar Threads
- plzz solve my problem (C++)
- Anyway can help me to solve this problem??? (C++)
- C++ Question...with uncompleted answer..anyone can solve it? (C++)
- CDBException can't solve problem (ASP.NET)
- [B]What changes need to be made to the above database definition in order to solve al (Visual Basic 4 / 5 / 6)
- please help been at my pc for hours still cannot solve problem (Viruses, Spyware and other Nasties)
Other Threads in the C Forum
- Previous Thread: Read an Integer from the User, Part 3
- Next Thread: A Very Simple Recursionn
| Thread Tools | Search this Thread |
adobe ansi api array asterisks binarysearch calculate centimeter char character convert copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax directory feet fflush file floatingpointvalidation fork forloop frequency givemetehcodez global grade gtkgcurlcompiling hacking highest homework i/o inches infiniteloop interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate looping loopinsideloop. match meter microsoft mysql number oddnumber odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc process program programming pyramidusingturboccodes radix read recv recvblocked repetition research scanf scheduling segmentationfault send sequential single socket socketprograming socketprogramming stack standard string suggestions systemcall threads turboc unix urboc user variable voidmain() wab win32api windows.h






