subject

Basicamente en un programa de matrices donde hay que formar una cruz y una diagonal con 1 y ya está la cruz y las diagonales de 1 (? pero esa parte donde tengo que hacer la mitad de 2 me hace explotar
Alguien me dice que tengo que hacer porfavor

//matriz
#include
#define maxfil 100
#define maxcol 100
void llenar (int [maxfil][maxcol],int, int);
void mostrar (int[][maxcol],int, int);

main()
{ int M[maxfil][maxcol];
int n, m;//filas y columnas reales
n=11;
m=11;
llenar(M, n,m);
mostrar(M, n,m);
}
//construot funcione
void llenar (int X[maxfil][maxcol],int n, int m)
{int i, j;//indice i pra filas y j pra columnas
for(i=0;i { for(j=0;j {X[i][j]=0;
}
}
for(i=0;i {X[n/2][i]=1;
}
for(i=0;i {X[i][n/2]=1;
}
for(i=0;i {for(j=0;j {if(n==m)
{X[i][i]=1;
}
else
{X[i][i]=0;
}
}
}
for(i=0;i {X[i][(n-1)-i]=1;
}

}

void mostrar (int X[][maxcol],int n, int m)
{int i, j;//indice i pra filas y j pra columnas
for(i=0;i { printf("\n");
for(j=0;j {printf("%d ",X[i][j]);
}
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
Many everyday occurrences can be represented as a binary bit. for example, a door is open or closed, the stove is on or off, and the fog is asleep or awake. could relationships be represented as a binary value? give example.
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
You know the right answer?
Basicamente en un programa de matrices donde hay que formar una cruz y una diagonal con 1 y ya está...
Questions
question
Chemistry, 20.09.2020 03:01
question
English, 20.09.2020 03:01
question
History, 20.09.2020 03:01
question
Mathematics, 20.09.2020 03:01
Questions on the website: 13722363