Question: hello I am using code blocks to start this assignment. can you show me how to complete a function named post_4 that when given an
hello I am using code blocks to start this assignment. can you show me how to complete a function named post_4 that when given an array of ints, post_4 returns the number of elements from the array that come after the rightmost 4 in the array. the array will contain at least one 4.

DOD Wa use different methods of parameter passing within your functions. Lab Exercises 1. Create a C++ program named lab2_1.cpp which completes a function na number of elements from the array that come after the rightmost 4 in the int ary1[4] = {2, 4, 1, 2}; post_4( ary1, 4) // would return a 2 int ary2[5] = {4, 1, 1, 4, 2}; post_4( ary2, 5) // would return a 1 int ary3[5] = {4, 4, 1, 2, 3}; post_4( ary3, 5) // would return a 3 int ary4[1] = {4}; post_4( ary4, 1) // would return a // Precondition: nums contains at least one 4 int post_4(int nums[], int length) { Your main function may look like this: #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
