Write a Program to copy 2D array into another array

 Write a Program to copy 2D array into another array





#include<stdio.h>

int main()

{

    int array[3][3]={{1,2,3},{4,5,6},{7,8,9}},I,j;

    int A[3][3];

    for(I=0;I<3;I++)

    {

        for(j=0;j<3;j++)

        {

           A[I][j]=array[I][j];

        }

    }

    printf("Elements in array is:");

    for(I=0;I<3;I++)

    {

        for(j=0;j<3;j++)

    

        {

            printf("\n %d",A[I][j]);

        }

     }

    return 0;

}

No comments:

Powered by Blogger.