Given two vectors of integers (either positive, negative or zeros) v, and v, of length d, and d2 respectively, write a C function prodCartFilt that displays on the screen the cartesian produet of the two vectors, filtered by excluding the pairs of numbers that are either equal to each other or differ by 1. The prototype of the function should be the following: void prodCartFilt (int *vl, int dl, int *v2, int d2); Remember: the cartesian product of two sets of values is the set of all possible pairs combining one element of the first set and one element of the second set. Example: vl=(1,2,3) v2-(3,4,5,6) Filtered Cartesian product: (1,3), (1,4), (1,5), (1,6), (2,4), (2,5), (2,6), (3,5). (3,6). The excluded pairs are: (2,3), (3,3), (3,4). Choose the print format that you prefer.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question
Please code this asap i need to understand these questions and if possible please attach a pdf or word file so i can copy and paste it in codeblocks and run the program myself!
Given two vectors of integers (either positive, negative or zeros) v, and vz of length di and d2
respectively, write a C function prodCartFilt that displays on the screen the cartesian produet of
the two vectors, filtered by excluding the pairs of numbers that are either equal to each other or differ
by I. The prototype of the function should be the following:
vold prodcartFilt (int *vl, int dl, int *v2, int d2) 7
Remember: the cartesian product of two sets of values is the set of all possible pairs combining one
element of the first set and one element of the second set.
Example:
vl=(1,2,3) v2-(3,4,5,6) Filtered Cartesian product: (1,3). (1,4), (1,5), (1,6), (2,4), (2,5), (2,6), (3,5).
(3,6).
The excluded pairs are: (2,3), (3,3), (3,4).
Choose the print format that you prefer.
Transcribed Image Text:Given two vectors of integers (either positive, negative or zeros) v, and vz of length di and d2 respectively, write a C function prodCartFilt that displays on the screen the cartesian produet of the two vectors, filtered by excluding the pairs of numbers that are either equal to each other or differ by I. The prototype of the function should be the following: vold prodcartFilt (int *vl, int dl, int *v2, int d2) 7 Remember: the cartesian product of two sets of values is the set of all possible pairs combining one element of the first set and one element of the second set. Example: vl=(1,2,3) v2-(3,4,5,6) Filtered Cartesian product: (1,3). (1,4), (1,5), (1,6), (2,4), (2,5), (2,6), (3,5). (3,6). The excluded pairs are: (2,3), (3,3), (3,4). Choose the print format that you prefer.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L