We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C
- Arrays and Strings
- Array Reversal
- Discussions
Array Reversal
Array Reversal
Sort by
recency
|
847 Discussions
|
Please Login in order to post a comment
Saw a lot of code that prints the array just in reverse which is a perfect solution for this problem. If you want to actually reverse the array in your code and use it further I implemented the reversal with a xor swap. This way you don't need a temporary array or variable.
include
include
int main() { int num, arr, i; scanf("%d", &num); arr = (int) malloc(num * sizeof(int)); for(i = 0; i < num; i++) { scanf("%d", arr + i); }
}
finally done something on my own `
include
include
int main() { int i, j, num; scanf("%d", &num);
}
Here is Array Reversal in c problem solution - https://programmingoneonone.com/hackerrank-array-reversal-solution-in-c.html
include
include
int main(){
}