Program to copy the contents of one array into another in the reverse order

The below mentioned program copies the content of one array name ‘source’ into another array named ‘dest’ in the reverse order.
In case you have any queries related to the below mentioned program, please don’t hesitate to comment on this post. Your comments are always welcomed.

Output:

Also See:
1-Dimensional Array in C Programming Language

You may also like...

7 Responses

  1. Anonymous says:

    void main(){
    int a[5]={1,2,3,4,5},b[5];
    int i,j,count=0;
    for(i=0;i<5;i++){
    printf(“Input array %d\t”,a[i]);
    count++;
    }
    for(j=0;j<5;j++){
    b[j]=a[count];
    count–;
    printf(“Reversed array %d\t”,b[j]);
    }
    }

  2. Anonymous says:

    void main( )
    {
    const int max=5;
    int rev[max]={0},arr[max]={1,2,3,4,5};
    int i;
    for(i=0;i rev[max-1-i]=arr[i];
    for(i=0;igetchar();
    }

  3. Anonymous says:

    love it awsum:)

  4. Wins D Race says:

    for(i=0,j=no-1;i dest[j]=source[i];

    I think this statement plays important role. Will you please explain about “for(i=0,j=no-1;i
    Regards
    Anurag

  5. Anonymous says:

    int elements[100];
    int i;
    int numberElements;
    printf(“Donner le nombre des elements : “);
    scanf(“%d”,&numberElements);
    for(i=1;i< =numberElements;i++)
    {
    printf(“Entrer l’element %d : “,i);
    scanf(“%d”,&elements[i]);
    }
    for (i=numberElements; i>=1 ; i–)
    {
    printf(“%d “,elements[i]);
    }
    return 0

  6. Anonymous says:

    How would you do this with a 2-dimmension array?

Leave a Reply

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