Lines 34 through 49 need more thinking.
First, the only time you do anything is if
arrayPlace == i (line 37). So why are you looping for i = 0..9 (line 34)?
Next, given your array of numbers:
+---+---+---+---+---+---+---+---+---+---+
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|
+---+---+---+---+---+---+---+---+---+---+
^arrayPlace |
If the first thing you do, on line 39, is replace the number at
i==arrayPlace, then you wind up with:
+---+---+---+---+---+---+---+---+---+---+
| 1 | 2 | 3 | 4 | -3| 6 | 7 | 8 | 9 | 10|
+---+---+---+---+---+---+---+---+---+---+
^arrayPlace |
You've lost a number!
You should shift the numbers first.
The only remaining issue is that the unnecessary loop on line 32 did have the side effect of protecting you against your user entering a bad
arrayPlace. You could change line 34 to read something like:
if (arrayPlace >= 0 && arrayPlace < 10)
That way nothing happens if the user enters an invalid number.
One final thing to notice. Line 30 disagrees with line 16:
Enter number 1:1
Enter number 2:2
Enter number 3:3
Enter number 4:4
Enter number 5:5
Enter number 6:6
Enter number 7:7
Enter number 8:8
Enter number 9:9
Enter number 10:10
Enter the new number you want to place in the array:-3
Enter a place from 0-9 to insert the array:
|
/me "What? The elements are listed as 1-10."
Keep your language consistent with the user. Let him enter a number in 1-10. Once you have that, just subtract one from whatever he gave you.
Pretty good otherwise! Hope this helps.
[edit] BTW, a program "crashes". It doesn't crush. Tin cans and submarines and boxes get crushed. Programs drive off the road into forests full of trees and bushes and angry bears and little biting
bugs.
:O)