Get Answers to all your Questions

header-bg qa

Write a program for n numbers to reverse the array

Answers (1)

best_answer

// C program to reverse an array

#include<stdio.h>
int main()

//fill the code;
int n;
scanf(“0”,&n);
int arr[n];
int i;
for(i = 0; i < n; i++)

scanf(“0”,&arr[i]);

printf(“Reversed array is: ”);
for(i = n-1; i >= 0; i–)

printf(“0 ”,arr[i]);

return 0;

Posted by

Deependra Verma

View full answer