-
Notifications
You must be signed in to change notification settings - Fork 0
/
4x4_Matrix.c
40 lines (33 loc) · 938 Bytes
/
4x4_Matrix.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<stdio.h>
int main()
{
int i,j,temp,precision;
float Number, Average, Matrix[4][4];
float Logic_Array[4][4] = {{12,-6,-14,8},{-3,2,-2,3},{-4,-1,1,4},{-5,5,15,-15}};
printf("Enter a Number: ");
scanf("%f",&Number);
printf("\n\n");
Average = Number/4.0;
temp = Average;
if(Average > temp)
precision = 2;
else
precision = 0;
for(i=0; i<4; i++)
{
for(j=0; j<4; j++)
{
Matrix[i][j] = Average + Logic_Array[i][j];
}
}
for(i=0; i<4; i++)
{
for(j=0; j<4; j++)
{
printf("%.0f\t",Matrix[i][j]);
}
printf("\n");
}
printf("\n\nIt's Nice Man.\n");
return 0;
}