Pesquisar neste blog

terça-feira, 6 de janeiro de 2009

Exemplo Matriz 5x5

#include stdio.h
#include conio.h


main () {

int m[5][5],l,c,valor;
valor = 1;

for (l=0; l<5; l++)
{
for (c=0; c<5; c++)
{
m[l][c]=valor++;
}
}

for (l=0; l<5; l++)
{
for (c=0; c<5; c++)
printf("%5d",m[l][c]);
printf("\n");
}
getch();
}

Nenhum comentário: