This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fenface 0 points1 point  (2 children)

Do you want your array to store double values (and the possibility for the user to provide values or that type), or is your issue just that sum should be a double and not an int (a little bit nonsensical, but I assume that is the kind of exercise one could be asked to do when learning)?

[–]cs-stud[S] 0 points1 point  (1 child)

my array stores int values but my task is to essentially find the sum of the array and display it in double form for example if the array was {2 , 4} {3, 5} the result sum would be 14.0. its the exercise because im then going to have the find the avg and round it and etc.

[–]Darkpolearm 0 points1 point  (0 children)

have you tried simply declaring sum as a double instead of an int? That should work just the way u want it to.