Discrete Math - Algorithm

Write an algorithm that inputs a number n followed by an array of n numbers and outputs the number of values of i, with i between 1 and n-1 such that ai < ai +1. {i| i is a natural number and 1 <= i <= n-1 and ai < ai +1}

Sample Solution