How can i transform this into c++

I have to change this GSM telecoms Frequency Encoding Algorithm into a C++ formula so i can build a cin for the user to input their frequency and based on this Algorithm the frequency is changed to a given range Frequency.

The Frequency Encoding Algorithm is as follows:


S = 1024 - max [(ai - a(i-1)mod(n+1)-1) mod 1024]

Any tips for this one?
The modulo operator in C is %.

That's all I can say. I'd need to know what 'a' and 'max' are.
Topic archived. No new replies allowed.