Showing posts with label Program to copy the content of one array into another. Show all posts
Showing posts with label Program to copy the content of one array into another. Show all posts

Wednesday, July 20, 2011

Program to copy the content of one array into another

/*Serial No.81     [swami55.cpp]*/

#include<stdio.h>
#include<conio.h>
void main()
    {
        int i,arr1[5],arr2[5];
        printf("Enter 6 numbers:=\n");
        for(i=0;i<6;i++)
            {
                scanf("%d",&arr1[i]);
            }
        for(i=0;i<6;i++)
            {
                arr2[i]=arr1[i];
            }
        printf("copied array:=\n");
        for(i=0;i<6;i++)
            {
                printf("%d\n",arr2[i]);
            }
        getch();
    }