Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #define FIL 4
  3. #define COL 4
  4.  
  5. float traza (float(*m)[COL]);
  6. int simetrica (float(*m)[COL]);
  7.  
  8. int main (void){
  9.  
  10. float mat[FIL][COL];
  11. int i,j;
  12.  
  13. for(i=0;i<FIL;i++){
  14. for(j=0;j<COL;j++){
  15. printf("Introduzca los elementos de la matriz del %d %d \n",i+1,j+1);
  16. scanf("%f",&mat[i][j]);
  17. }
  18. }
  19. printf("La traza es: %f",traza(mat));
  20.  
  21. return 0;
  22. system("pause");
  23. }
  24.  
  25. float traza (float(*m)[COL]){
  26.  
  27. int i,traza;
  28.  
  29. for(i=0;i<FIL;i++){
  30. traza+=m[i][i];
  31. }
  32. return(traza);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement