Trim the extra curly brace in search.
Change thisto thisCode:search(array[],j,10);everywhere execpt the definition of array[].Code:search(array,j,10);
Add the missing semicolons to your printf statements. [edit]You may want to add newlines to the format string too.