problem 3:
find out from how many not falling sequences is the matrix made of
e.g.
4 32 5 1 2 6 7
answer 3
solution:
#include <stdio.h>
int main(void){
int matrix[]={3,3,5,6,3,25,6,3,6,7,8,6}; //answer should be 5
int counter=1;
int i;
for(i=1; i<sizeof(matrix)/sizeof(matrix[0]); i++){
if(matrix[i-1]>matrix[i])
counter++;
}
printf(" %d sequences\n", counter);
return 0;
}
~ ~ ~ ~