# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
main ()
{
int op=0;
while (op!='n' && op!='N')
{
system ("cls");
printf ("t..::ESTE PROGRAMA SUMA LOS VALORES DE LA DIAGONAL PRINCIPAL DE UNA MATRIZ CUADRADA::..n");
printf ("t______________________________________________________________________________________nn");
int dim=0, punf=0, punc=0;
//INGRESO DE LA DIMENSION DE LA MATRIZ
printf ("INGRESE LA DIMENSION DE LA MATRIZ CUADRADA: ");
scanf ("%d", &dim);
int mat1[dim][dim];
//INGRESO DE DATOS PARA LA MATRIZ
printf ("nINGRESO DE VALORES PARA LA MATRIZn");
for (punf=0; punf<dim; punf++)
{
printf ("n");
for (punc=0; punc<dim; punc++)
{
printf ("tIngres un valor en la Fila [%d] Comlumna [%d]: ", punf+1, punc+1);
scanf ("%d", &mat1[punf][punc]);
}
}
//MUESTRA LA MATRIZ INGRESADA
printf ("nMATRIZ INGRESADAn");
for (punf=0; punf<dim; punf++)
{
printf ("n");
for (punc=0; punc<dim; punc++)
{
printf ("t%d", mat1[punf][punc]);
}
}