Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Arrays/Array_reversal.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include<stdio.h>
#define N 1000

int main(){
int arr[N];

//giving the size of an array
int n;
printf("enter the size of array:\n");
scanf("%d", &n);

// Printing the array that will be reversed
printf("Enter the array:\n");
for(int i=0; i<n; i++){
scanf("%d", &arr[i]);
}

// printing the reversed array
printf("eversed array:\n");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed typo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"eversed array" → "Reversed array"

for(int i=n-1; i>=0; i--){
printf("%d ", arr[i]);
}
return 0;


}