תרגיל בc
#include <stdio.h> void main() { int arr[4][3]; int row,col,sum=0,kamut=0,sumcol=0,sumrow=0; for(row=0;row<4;row++) { for(col=0;col<3;col++) { printf("enter the numbers for arrays:"); scanf("%d",&arr[row][col]); sum+=arr[row][col]; if(arr[row][col]%2==0) { kamut+=1; } sumcol+=arr[row][col]; } printf("the sum of this col is :%d",sumcol); sumcol=0; printf("\n"); } for(row=0;row<4;row++) { for(col=0;col<3;col++) { printf("%3d",arr[row][col]); } printf("\n"); } printf("The sum of matrix is %d\n",sum); printf("the amount of double numbers is %d\n",kamut); } תוכנית שקולטת לתוך מערך מספרים ומראה את הסכום של המטריצה כמה מספרים במטריצה זוגיים מראה את הסכום של כל שורה בנפרד השאלה היא איך אני סופר את הסכום של כל עמודה ועמודה בנפרד?????? תודה מראששש
#include <stdio.h> void main() { int arr[4][3]; int row,col,sum=0,kamut=0,sumcol=0,sumrow=0; for(row=0;row<4;row++) { for(col=0;col<3;col++) { printf("enter the numbers for arrays:"); scanf("%d",&arr[row][col]); sum+=arr[row][col]; if(arr[row][col]%2==0) { kamut+=1; } sumcol+=arr[row][col]; } printf("the sum of this col is :%d",sumcol); sumcol=0; printf("\n"); } for(row=0;row<4;row++) { for(col=0;col<3;col++) { printf("%3d",arr[row][col]); } printf("\n"); } printf("The sum of matrix is %d\n",sum); printf("the amount of double numbers is %d\n",kamut); } תוכנית שקולטת לתוך מערך מספרים ומראה את הסכום של המטריצה כמה מספרים במטריצה זוגיים מראה את הסכום של כל שורה בנפרד השאלה היא איך אני סופר את הסכום של כל עמודה ועמודה בנפרד?????? תודה מראששש