Maximum profit earned by buying and selling shares any number of times

Given a list containing future prediction of share prices, find maximum profit that can be earned by buying and selling shares any number of times with constraint that a new transaction can only start after previous transaction is complete. i.e. we can only hold at-most one share at a time.  

Implement itoa() function in C

Write an efficient function to implement itoa() function in C. Standard itoa() function convert input number to its corresponding C-string using the specified base.