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
|
830 Discussions
|
Please Login in order to post a comment
//reverversing without third variable
for (int i=0; i
include
int main() { int size; scanf("%d", &size); int arr[size]; for (int i = 0; i < size; i++) { scanf("%d", &arr[i]); } for (int i = size - 1; i >= 0; i--) { printf("%d ", arr[i]); } return 0; }
include
include
int main() { int n,j,i; scanf("%d", &n); int arr[n]; int length=sizeof(arr)/sizeof(arr[0]); for(j=0;j
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); } arr[i]=i+1;
}