I keep getting an exit status 1 expected primary-expression before ')' token for my code
This int ctr = () should probably be int ctr = 0

The for loop syntax is incorrect, see: https://www.tutorialspoint.com/cplusplus/cpp_for_loop.htm

The first for loop needs a } at the end.