Reverse Array Placements Practice 7
For Complete YouTube Video: Click Here
In this class, we will understand Reverse Array Placements Practice 7.
The entire course of C Programming with more than 110+ videos of content or playlist has already been published.
We have covered all the concepts of C Programming in a very detailed way.
C Programming Complete Playlist on YouTube: Click Here
All the concepts discussed in this course are the models frequently asked in Campus Placements Questions, either in multiple-choice questions or as programming questions.
This entire course will help a Computer Science Engineering Student or a student in any other stream crack the campus placements drives held by Service-based Software or IT companies like TCS, Infosys, CTS, Wipro, Accenture, etc.
Reverse Array Placements Practice 7
The Function reversearray(int arr[]) has Array arr as an argument. For example, if the input array arr is {20,30,10,40,50} the function is expected to return {50,40,10,30,20}.
Given Code:
int reversearray(int *arr, int len) { int i, temp, originallen=len; for(i=0;i<=originallen/2;i++) { temp = arr[len-1]; arr[len-1] = arr[i]; arr[i] = temp; len += 1; } return arr; }
In the above code, there are some mistakes in the problem.
The explanation of the question is provided in the above YouTube link.