Ok, this isn't a school assignment...just a random exercise I found on the internet since I'm beginning to learn a bit about arrays. For my version, user enters the number of indexes the array will have, and then enters data for the elements, and we output the sum. The sort of tricky part (part of the exercise I suppose is thinking about primitive variables) is that the input for elements should be a char representing a single integer and output should be in terms of a long. Again, not really sure why because I would not go about the task this way...but I want to complete the exercise per instructions as a learning experience.
The program below compiles fine. However, let's say I chose 1 index for my array, and enter 1 as my element..the program returns 49. If I chose 1 index and enter 2 as my element, it returns 50...and so on according to pattern. My question is first can you point me in the direction of where I'm going wrong? Second, I guess this is more theoretical, any ideas for why it is beginning at 49?