How do I make the array to be rotated with the while loop? My teacher wants the array to be displayed with the while loop I just know how to do with the for loop. Here is an example of how I did it:
#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
}