I'm trying to fill out an array from 0 to 90 in increments of 5, however once I get to 45, the next number is a large random number and the program terminates. Not sure why this is happening. Can someone please help me out with this?
You've declared an array with 50 elements, so the valid element subscripts run from 0 to 49. Your loop then tries to access up to 90, so that's out of bounds.
I'd probably run the loop from 0 to < 50 and do something like degTheta[i] = 5*i.