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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:40, dkjfghdjk
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, Timeisjesus
Answer these and get 40 points and brainliest
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, silviamgarcia
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
image
Computers and Technology, 24.06.2019 12:40, kanga06
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
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 in other subjects:

Konu
Mathematics, 23.01.2020 07:31