| | |
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 api array arrays binarysearch calculate centimeter char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking hardware highest homework i/o ide inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation pattern pdf performance pointer posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h






