Computer Science, asked by saliravindram, 1 year ago

write a program for n numbers to reverse the array

Answers

Answered by maryjessicka
0
#include <stdio.h>   int main () {    int a[ 10 ]; /* a is an array of 10 integers */    int i,j;      printf(“Enter number of items :”);    scanf(“%d”, &n);       for ( i = 0; i < n; i++ )    {       printf(“Enter a number:”);       scanf(“%d”,&a[i]);    }       printf(“Reversed Array:”);      for (j = n-1; j >= 0; j-- )    {       printf("%d ", a[j] );    }      return 0; }



Answered by unknownRU
0

Hope it helps?

Mark me as Brainlist!

Reverse of an array in c programming

#include<stdio.h>

#include<conio.h>

void main ()

{

clrscr();

int arr[5],i;

printf("enter marks of five students");

for(i=0;i<5;i++)

{

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

}

printf("the reverse elements are\n");

for(i=4;i>0;i--)

{

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

}

getchar();

}

Similar questions