Write a C++ function that accepts array size and pointers to three arrays a1, a2 and...

90.2K

Verified Solution

Question

Programming

Write a C++ function that accepts array size and pointers tothree arrays a1, a2 and a3 of type float as parameters. It thenmultiplies a1 and a2 and stored the result in a3. Assume that arraymultiplication is done by multiplying corresponding array elements,e.g. a3[i] = a1[i] * a2[i] where 0 <= i <= (array size – 1)Write a C++ main program to dynamically create three equal sizedfloat arrays a1, a2 and a3. The size of the arrays is given by theuser at run time. The values for array elements for a1 and a2 arealso given by the user at run time by entering the values onkeyboard when prompted by the program. The program should then callarray multiply function to multiply two arrays (a1 * a2) and storethe results in array a3. After the array multiplication is computedby the program print the resulting array a3 on the screen. The sizeof the arrays and values of array elements will be given to you byyour GAs.

Answer & Explanation Solved by verified expert
3.9 Ratings (752 Votes)
Codeinclude using    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students