Question: Can someone help me to find the bugs // Program passes an array to a method that reverses // the positions of the values start
Can someone help me to find the bugs
// Program passes an array to a method that reverses // the positions of the values start Declarations num LENGTH = 4 num vals[LENGTH] = 33, 55, 77, 99 num sub output "At beginning of main() method..." sub = 0 if sub < LENGTH output vals[sub] sub = sub + 1 endif reverseTheValues(vals) output "At end of main() method.........." sub = 0 while sub < LENGTH output vals[sub] sub = sub + 1 endwhile stop
void reverseTheValues(num values) num temp temp = values[0] values[0] = values[3] temp = values[1] values[1] = values[2] values[2] = temp return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
