Written by Sai Sandeep Thota on January 13, 2013 in C > Programming

C Program to Reverse an Array Elements

GET ALERTS:

Get our Latest updates delivered to your mailbox!

Reversing elements of an Array is similar to String Reverse Program.

#include<stdio.h>
#include<conio.h>
void main()
{
	int i, size, elements[100];
	clrscr();

	printf("\nEnter Size:");
	scanf("%d",&size);

	printf("\nEnter Numbers:");
	for(i=0;i<size;i++)
		scanf("%d",&elements[i]);

	printf("\nReversed Array:");
	for(i=size-1;i>=0;i--)
		printf("%d ",elements[i]);
	getch();
}

Output:
Array-Reverse

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: