[Solved] what is the algorithm for function that check how many series in ascending order array have. and detect the longest series in c


#include <stdio.h>

int main(){
    int arr[] = {12,3,4,23,5,46,5,6,7,78,67,68,134,45,46,47,67,11,23,18,-3};
    int count = 21;
    int i;
    int pos=0, len=0;

    for(i=0;i<count-1;++i){//i<count-1-len
        int k;
        for(k=0;arr[i+k]<arr[i+k+1];++k)
            ;
        if(k>len){
            len = k;
            pos = i;
        }
        i += k;
    }
    printf("Longest series: ");
    for(i=pos;i<=pos+len;++i)
        printf("%d ", arr[i]);
    printf("\n");
    return 0;
}

solved what is the algorithm for function that check how many series in ascending order array have. and detect the longest series in c