lundi 1 octobre 2018

Function that produces first index of ''3 in a row number occurrence''

i want to create a function that taken the inputs of an array and its number of values. The function should look through the array and as soon as it sees a ''3 in a row''(e.g { 1 2 3 4 5 5 5 6 7 8}), in this case 5. The function should print the index of the first 5. Im new to coding so im finding it difficult how to being. Ive made an attempt but dont know how to proceed.

int NewFunction(int array, int numValues){
int i;
for(i=0;i<numValues;i++){
if

Aucun commentaire:

Enregistrer un commentaire