After adding the first element your found
is always 1
. Reset found
to 0
before the next iteration.
2
solved 1D array manipulation iteration using loop and switch statement
After adding the first element your found
is always 1
. Reset found
to 0
before the next iteration.
2
solved 1D array manipulation iteration using loop and switch statement