There is a code segment written for you that reads the following for two different three dimensional (3D) vectors (vector1 and vector2):
- An integer x, as the x dimension of a 3D vector,
- An integer y, as the y dimension of a 3D vector,
- An integer z, as the z dimension of a 3D vector.
- Define a struct with three fields, and name:
- Name: Vector3D
- Fields: three integers x, y, and z (representing the three dimensions).
- Write a code segment which performs an elementwise addition and an elementwise multiplication
operation on two Vector3D structs (vector1 and vector2). The result
of the addition operation should be kept in sumVector, and the result of the multiplication operation should be kept in
productVector.
Examples:
3 5 7
2 4 -1
|
5 9 6
6 20 -7
|
1 2 1
2 3 2
|
3 5 3
2 6 2
|
5 15 7
0 0 0
|
5 15 7
0 0 0
|
Important issues about all exams/projects/quizzes:
- Update just Question.c file, not Question.txt.
- Make changes only between the following comments(DO NOT modify these comments or anything outside the region marked by the comments):
- // DO_NOT_EDIT_ANYTHING_ABOVE_THIS_LINE
- // DO_NOT_EDIT_ANYTHING_BELOW_THIS_LINE
- If you modify these comments for any reason, you can copy/paste the initial version from Question.txt into Question.c. Note that Question.txt is not graded at all, so anything you write in Question.txt will be discarded.
- To avoid getting the 'Binary Not Found' error, SAVE and BUILD your code before RUN.
- Do not add any extra messages message for input/output such as 'Enter an integer:', 'The result is:', etc. Any additional text that appears in the output will cause you to get no points from the question.
- Input and output of your program must be just like those in the Examples table above.