Assignment 6
Consider a structure S that has two real number members x and y. If A, B and C are instances of S, demonstrate functions that:
a. Adds corresponding elements of structure S where the structure are two real numbers x and y (as if C=A+B and S is a 2x1 matrix).
b. Subtracts the corresponding elements of the first with the second (C=A-B).
c. Multiple the corresponding elements of the first with the second
(C.x=A.x * B.x and C.y=A.y * B.y)
PS: The program should be coded in both C and C++.
|