Skip to content

Instantly share code, notes, and snippets.

@anisur3036
Created October 31, 2022 17:24
Show Gist options
  • Save anisur3036/1f4ea0613c2733274629c7c574de1634 to your computer and use it in GitHub Desktop.
Save anisur3036/1f4ea0613c2733274629c7c574de1634 to your computer and use it in GitHub Desktop.
Print a reverse order of an array in C language
/*
*Write a C program to take one positive integer N, the size of an array as input.
*Then take an integer array of size N as input and show output in reverse order.
*/
#include <stdio.h>
int main() {
int i, N;
scanf("%d", &N);
int arr[N];
for(i=0; i<N; i++) {
scanf("%d", &arr[i]);
}
for(i=(N-1); i>=0; i--) {
printf("%d", arr[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment