Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define size 4
- void setNull(double array[][size])
- {
- for(int i = 0 ; i != 4 ; ++i)
- {
- array[i][i] = 0;
- }
- }
- void print2dArray(double array[][size])
- {
- for(int i = 0; i!= size ; ++i)
- {
- for(int j = 0 ; j != size; ++j)
- {
- printf("%.2lf ",array[i][j]);
- }
- printf("\n");
- }
- }
- int main()
- {
- double array[size][size]= {{2,4,-6,7.4},
- {4.5,-3,5,0},
- {9.7,4.2,-3.8,2.75},
- {3.3,-0.6,0,3.5}};
- setNull(array);
- print2dArray(array);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement