Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Crie a seguinte matriz quadrada. O tamanho da matriz é informado inicialmente pelo usuário. Neste caso o valor informado foi 7.
- #include<stdio.h>
- int main()
- {
- int linhas, colunas, i, j;
- printf("Entre com a quantidade de linhas e colunas(ex: lin col): ");
- scanf("%d %d", &linhas, &colunas);
- int matriz[linhas][colunas];
- for(i=0; i<linhas; i++){//iniciando o preenchimento da matriz
- for(j=0;j<colunas; j++)
- printf("%d ", j+1);
- printf("\n");
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment