Question: In C language, Arrays Homework. As a practical joke, a friend gives you an int array for your birthday. As if that was not bad

In C language, Arrays Homework. As a practical joke, a friend gives you an int array for your birthday. As if that was not bad enough, your friend tells you that the array contains almost all 0's except for a small string of consecutive 1's contained somewhere in the middle. Overwhelmed by the novelty of this you decide to write a function that will print out the location of the first 1 in the array, the location of the last 1 in the array, and the total number of 1's in the list of consecutive 1 values. Given below is the function prototype: void joke (int num[ ], int max);

Where num is the array of int values and max contains the number of elements in the array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!