0
How do I make the matrix be rotated with the while loop? My teacher wants the matrix to be displayed with the while loop I only know how to do with the for loop. Follow example with errors of how I did:
#include<stdio.h>
void main(){
int inteiros[5][5];
int i = 0, j = 0;
//copia do teclado
while(*inteiros != NULL){
scanf("%d", &inteiros[i][j]);
i++;
j++;
}
//imprime como formato de matriz
while(*inteiros != NULL){
printf("%d", inteiros[i][j]);
i++;
j++;
printf ("\n");
}
printf("\n\n");
//matriz diagonal principal
while(*inteiros != NULL){
scanf("%d", &inteiros[i][j]);
if(i == j){
printf( "[%d][%d] : %d. ", i, j, inteiros[i][j] );
}
i++;
j++;
}
printf("\n");
//matriz inversa
}
which error is occurring?
– Marco Souza
C# and C are two things well different.
– Jéf Bueno
I know :/ I put two tags to draw more attention, even.
– Aline
@Dotnet actually doesn’t work as expected.
– Aline