Computer Science, asked by prakharpranayshukla, 3 days ago

write a program in c to enter 10 in array.Reverse it's element and print them
please if any body know answer me​

Answers

Answered by samarthkrv
1

Answer:

#include <stdio.h>

void reverse(int arr[] , int len){

   int b[len];

   int j = len;

       for(int i = 0; i < len; i++){

           b[j-1] = arr[i];

           j--;

       }

       for(int i = 0; i < len; i++){

           printf("%d " , b[i]);

       }

}

int main() {

   int arr[10];

   int len = 10;

   printf("Enter all 10 elements \n");

       for(int i = 0; i < 10; i++){

           scanf("%d" , &arr[i]);

       }

   printf("ORIGINAL \n");

       for(int i = 0; i < len; i++){

           printf("%d " , arr[i]);

       }

   printf("\n");

   printf("REVERSE \n");

   reverse(arr , 10);

}

Explanation:

Similar questions