Copy of Array Elements in Reverse Order


//	copy of array in reverse order
#include<stdio.h>
#include<conio.h>
void main()
{
	int arr1[5],arr2[5],i,j;
	clrscr();
	printf("\n Enter 5 Array Elements :");
	for(i=0;i<=4;i++)
		scanf("%d",&arr1[i]);
	for(i=0,j=4;i<=4;i++,j--)
	{
		arr2[j]=arr1[i];	// values interchanged
	}
	printf("\n After Interchanging :");
	for(i=0;i<=4;i++)
	{
		printf("%d\n",arr2[i]);
	}
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming