EmbLogic's Blog

Reversing of array.

head 1.2;
access;
symbols;
locks
root:1.2; strict;
comment @ * @;

1.2
date 2002.01.01.01.04.00; author root; state Exp;
branches;
next 1.1;

1.1
date 2002.01.01.00.56.25; author root; state Exp;
branches;
next ;

desc
@used tem variable to interchange the position.
array is reversed with the help of temp variable.
@

1.2
log
@initialised temp=0
reversing of array is successfully completed.
@
text
@#include
int main()
{
int i=0;
int arr[10];
int temp=0;

printf(“enter the array elements\n”);
for(i=0;i<=10;i++)
{
scanf("%d", &arr[i]);
}
for(i=0;i<=10;i++)
{ printf(" array is %d:%d\n", i,arr[i]);

}

for(i=0;i<5;i++)
{
temp = arr[i];
arr[i]= arr[10-i-1];
arr[10-i-1] = temp;
}

for(i=0;i<=10;i++)
printf("array is %d:%d\n", i,arr[i]);

return 0;
}

@

1.1
log
@Initial revision
@
text
@d4 1
a4 1
int i;
d6 1
a6 1
int temp;
@

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>