programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Reverse Elements in Array

Details
Written by: RajaSekhar
Category: C Programs
  • Arrays in C
#include<stdio.h>
int main()
{
	int n, i, j, *p, a[10], b[10];
	printf("Enter the number of elements :: ");
	scanf("%d", &n);



	printf("Enter the elements : ");
	for(i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
	}

	//REVERSING THE ARRAY

	p=a;
	for(i = 0, j = n-1; i < n; i++, j--)
	{
		b[i] = *(p+j);
	}
	printf("The reversed array :: ");

	for(i = 0; i < n; i++)
		printf("%d  ", b[i]);

	printf("\n");
	return 0;
}

 OUTPUT:

Enter the number of elements :: 6
Enter the elements : 10 20 30 40 50 60
The reversed array :: 60  50  40  30  20  10

Previous article: C Program for MERGING of Two Arrays with out using Third Array Prev Next article: C Program to Perform Operations on Doubly Linked List Next
  • C Program to Print PRIME Numbers in a Given Range
  • C Program to Implement STACK Operations Using Pointers
  • Evaluate Algebraic Expression (ax+b)/(ax-b)
  • C Program to Implement RADIX SORT
  • C program to Implement BREAK Statement
  • Implementation of Queue using Array in C
  • Binary Search Program in C using Recursive and Non-Recursive Methods
  • C Program to Copy Contents From One File to Another
  • C Program to Implement Doubly Linked List Operations
  • Implementation of Stack Using Array in C
  • C Program for Circumference of a Circle
  • C Program to Implement BINARY SEARCH
  • Finding GCD and LCM of Given Numbers using C
  • C Program to Search an Array Element using BINARY SEARCH
  • C Program for Arithmetic Operations using Switch Statement
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top