اكتب برنامج بلغة C لمصفوفة ثنائية الأبعاد بحجم 3x3 واطبع المصفوفة
- برمجة
- برمجة سي c
- 2021-05-05
- Wassim
الأجوبة
/*Write a program in C for a 2D array of size 3x3 and print the matrix*/
#include <stdio.h>
void main()
{
int arr1[3][3],i,j;
printf("\n\nRead a 2D array of size 3x3 and print the matrix :\n");
printf("------------------------------------------------------\n");
/* Stored values into the array*/
printf("Input elements in the matrix :\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("element - [%d],[%d] : ",i,j);
scanf("%d",&arr1[i][j]);
}
}
printf("\nThe matrix is : \n");
for(i=0;i<3;i++)
{
printf("\n");
for(j=0;j<3;j++)
printf("%d\t",arr1[i][j]);
}
printf("\n\n");
}القوائم الدراسية التي ينتمي لها السؤال